[Spice_discussion] Spice_discussion Digest, Vol 68, Issue 4, SPICE and multi-threading

Henry DeWitt hdewitt at dewitt-assoc.com
Mon Sep 29 12:23:59 PDT 2014


I use SPICE in a Microsoft Visual Studio C++ multi-threaded application 
where more than one thread may access position information for the body 
of interest.

Doing this requires that there be a globally accessible CMutex object 
associated with SPICE and that any thread wanting to access SPICE must 
lock the object for the duration of the access.

What this accomplishes is making sure that only one thread at a time is 
accessing SPICE.  Simultaneous access to SPICE by more than one thread 
will definitely not work.

Henry DeWitt

On 9/29/2014 3:00 PM, spice_discussion-request at naif.jpl.nasa.gov wrote:
> Send Spice_discussion mailing list submissions to
> 	spice_discussion at naif.jpl.nasa.gov
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://naif.jpl.nasa.gov/mailman/listinfo/spice_discussion
> or, via email, send a message with subject or body 'help' to
> 	spice_discussion-request at naif.jpl.nasa.gov
>
> You can reach the person managing the list at
> 	spice_discussion-owner at naif.jpl.nasa.gov
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Spice_discussion digest..."
>
>
> Today's Topics:
>
>     1. SPICE and multi-threading? (Bridgman, William T.)
>     2. Re: SPICE and multi-threading? (Ed Wright (JPL))
>     3. SPICE C or FORTRAN toolkit with Julia experience?
>        (Gregory Lemieux)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 29 Sep 2014 12:12:26 -0400
> From: "Bridgman, William T." <William.T.Bridgman at nasa.gov>
> To: spice_discussion <spice_discussion at naif.jpl.nasa.gov>
> Subject: [Spice_discussion] SPICE and multi-threading?
> Message-ID: <210B0DFD-F3F3-4E58-87B6-47E83F649CEB at nasa.gov>
> Content-Type: text/plain; charset="windows-1252"
>
> Has anyone on the list used SPICE in a multi-core, multi-thread environment?  Basically calling SPICE in multiple threads sharing the same memory on a multi-core processor(s).
>
> I?ve tried this launching multiple instances of python-wrapped SPICE for the case where I?m retrieving position snapshots of the same set of spacecraft and planets, but at multiple times (for generating animations).  The results were inconsistent and I switched back to single thread operation.
>
> If SPICE is thread-safe, then I?ve probably done something wrong (perhaps not completely initializing or closing SPICE for each thread?)
>
> Are there any guidelines available?
>
> Thanks,
> Tom
> --
> Dr. William T."Tom" Bridgman               Scientific Visualization Studio
> Global Science & Technology, Inc.          NASA/Goddard Space Flight Center
> Email: William.T.Bridgman at nasa.gov         Code 606.4
> Phone: 301-286-1346                        Greenbelt, MD 20771
> FAX:   301-286-1634                        http://svs.gsfc.nasa.gov/
>
>
>
>
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Mon, 29 Sep 2014 09:29:59 -0700
> From: "Ed Wright (JPL)" <Edward.D.Wright at jpl.nasa.gov>
> To: "Bridgman, William T." <William.T.Bridgman at nasa.gov>
> Cc: spice_discussion <spice_discussion at naif.jpl.nasa.gov>
> Subject: Re: [Spice_discussion] SPICE and multi-threading?
> Message-ID: <3328E6EA-8DA4-43CB-B244-4B9B82B5DC2F at jpl.nasa.gov>
> Content-Type: text/plain; charset=windows-1252
>
> To: Dr. William T. Bridgman
> From: Edward Wright
>
> On Sep 29, 2014, at 9:12 AM, Bridgman, William T. <William.T.Bridgman at nasa.gov> wrote:
>
>> Has anyone on the list used SPICE in a multi-core, multi-thread environment?  Basically calling SPICE in multiple threads sharing the same memory on a multi-core processor(s).
>>
>> I?ve tried this launching multiple instances of python-wrapped SPICE for the case where I?m retrieving position snapshots of the same set of spacecraft and planets, but at multiple times (for generating animations).  The results were inconsistent and I switched back to single thread operation.
>>
>> If SPICE is thread-safe, then I?ve probably done something wrong (perhaps not completely initializing or closing SPICE for each thread?)
>>
>> Are there any guidelines available?
>>
>> Thanks,
>> Tom
>> --
>> Dr. William T."Tom" Bridgman               Scientific Visualization Studio
>> Global Science & Technology, Inc.          NASA/Goddard Space Flight Center
> SPICE (all language versions) is in no way thread safe and cannot be made so without a major redesign and recoding.
>
> As always,
> Edward Wright (JPL)
> Edward.D.Wright at jpl.nasa.gov
>
>
>
>
> ------------------------------
>
> Message: 3
> Date: Fri, 26 Sep 2014 18:04:24 +0000
> From: Gregory Lemieux <Gregory.Lemieux at sslmda.com>
> To: "spice_discussion at naif.jpl.nasa.gov"
> 	<spice_discussion at naif.jpl.nasa.gov>
> Subject: [Spice_discussion] SPICE C or FORTRAN toolkit with Julia
> 	experience?
> Message-ID:
> 	<865B12E324F99040B0C7A79840F3AF42C7DDA542 at Blaziken.world.ssd.loral.com>
> 	
> Content-Type: text/plain; charset="us-ascii"
>
> Has anyone tried utilizing the SPICE toolkit with the Julia Language (http://julialang.org/) since its development a couple years ago?  I'm fairly new to the astrodynamics field and I'm currently pursuing classes in computational math to fill in the holes in my knowledge and experience.  I that pursuit, I'm seeing a few classes here and there being taught that utilize Julia.  The little that I've tinkered with it has been promising, but I'm curious to see if the language has seen adoption in the community given that it can call C and FORTRAN functions more or less directly.
>
> -----------------------------------
> Gregory Lemieux
> Orbital Dynamics Engineer
> SSL
> 3825 Fabian Way
> Palo Alto, CA 94303
> 650-852-5768
> www.sslmda.com
>
>
> ________________________________
> Please note that my e-mail address has changed. My new (current) address is Gregory.Lemieux at sslmda.com.
> ________________________________
> This message (including any attachments) may contain confidential information intended for a specific individual and purpose. If you are not the intended recipient, you should delete this message and any attachments.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://naif.jpl.nasa.gov/pipermail/spice_discussion/attachments/20140926/5422f709/attachment-0001.html>
>
> ------------------------------
>
> _______________________________________________
> Spice_discussion mailing list
> Spice_discussion at naif.jpl.nasa.gov
> https://naif.jpl.nasa.gov/mailman/listinfo/spice_discussion
>
>
> End of Spice_discussion Digest, Vol 68, Issue 4
> ***********************************************
>
>



More information about the Spice_discussion mailing list