comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: IDL/C structures in shared memory
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: IDL/C structures in shared memory [message #41002] Thu, 16 September 2004 18:40
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
milan08@hotmail.com (Erica Stanley) writes:
> I'm using shared memory to share information between C and IDL.
> (didn't want to use call_external because we could possibly be making
> frequent changes to the data and I would not want to have to issue a
> call_external command with every change) So I have a structure I'm
> sharing between IDL and C, but I currently have an IDL version of the
> structure and an equivalent C version. Ideally we would like to only
> maintain one version (either in IDL or C) to avoid discrepancies
> between the 2 versions. Does any one know a way around maintaing two
> versions of every structure we want to share? Thanks.

If I were you I would be very careful. I don't believe that IDL makes
any guarantees that the data for a variable will remain fixed in
memory while IDL code is executing.

If the data can only change when you make a call to an external
routine, then that is also the time to copy the structure into IDL
space.

If the application is multi-threaded, then the data can change at an
unpredictable time. Presumably you would need to implement some form
of locking protocol to prevent simultaneous access. That sounds
pretty complicated.

In either case, you will need some kind of access (or locking)
mechanism to get the data, so it seems pretty clear to me that it's
probably worth just copying the data into IDL space. If there are
real performance problems with that technique, as opposed to
hypothetical, then you can consider something more refined like shared
memory access.

Yours,
Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Previous Topic: Re: keeping a button widget depressed
Next Topic: Greetings From Munich

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 04:48:35 PDT 2025

Total time taken to generate the page: 2.08303 seconds