SHMMAP and IDL_IDLBridge [message #63082] |
Tue, 28 October 2008 11:11  |
Dan[1]
Messages: 7 Registered: June 2008
|
Junior Member |
|
|
Hi everyone,
I would like to use the SHMMAP with an IDL_IDLBridge, but I am not too
sure about the syntax.
Specifically, I would like to set up a shared memory space of about
300MB inside the parent class, stick a structure in it, and then call
an oBridge, but I don't know how to "restore" the shared memory from
inside the oBridge. Could someone give me an example of how I might
be able to do this?
Thanks.
|
|
|
Re: SHMMAP and IDL_IDLBridge [message #63153 is a reply to message #63082] |
Tue, 28 October 2008 20:17  |
Robbie
Messages: 165 Registered: February 2006
|
Senior Member |
|
|
You should be able to map a structure using SHMMAP, however, there are
a number of limitations which make it nearly useless:
1) You cannot have pointers or objects in your structure. This makes
sending variable size datasets very difficult
2) You cannot use strings. Instead you must create a fixed width
bytarr() and cast it to and from a string.
An alternative solution is to use CMSVLIB written by Craig Markwardt
http://www.physics.wisc.edu/~craigm/idl/
Using this package you should be able to convert any combination of
IDL variables into a bytarr() which can then be copied to shared
memory. This might be notably slower than the above solution but it is
more flexible.
Personally, I have taken a backwards step from using SHMMAP. If I
really need threads, then I choose a language which supports them.
Regards,
Robbie
|
|
|