Re: Can I have multiple threads in IDL? [message #40497 is a reply to message #40363] |
Mon, 09 August 2004 14:56  |
Peter Mason
Messages: 145 Registered: June 1996
|
Senior Member |
|
|
Marc Reinig wrote:
> Peter,
>
> Thanks for the response.
>
> I'm fairly new to IDL, so ... ;=)
>
> I know I can call IDL from a C program and use some of its functions.
> Can I use that to help me? I am unsure of the limitations.
>
> I have a complex function in IDL. IDL won't break up the computations
> into multiple threads for me the way it does for FFTs.
>
> So I was thinking of a different way to solve the problem without
> rewriting the entire function in C.
>
> Could I call a function in a DLM and pass it the total parameters.
> Have the DLM break it into 8 pieces, create 8 threads, and each
> thread would call my IDL function with it's piece, the original
> function would return with the result of the original call?
Hi Marc,
I'm out of my depth here. Last time I used anything like callable IDL
was... an embarrassingly long time ago. (Those days it was called RPC.)
I generally go the other way, using IDL as the "host" application.
It's possible that the approach you outlined above might work but there are
alarm bells going off in my mind: I have to wonder whether an IDL function
call is thread-safe. I know that you can do recursive function calls
within IDL (i.e., there is re-entrancy at that level), but there might be
more involved in calling an IDL function from several concurrent external
threads.
Hopefully, someone who reads this group has tried it and might post an
answer. Failing that, I can only suggest that you try it out - perhaps
with a simple task rather than the full-blown one.
Wouldn't it be nice if RSI exposed a threading mechanism in IDL? Even one
with constraints? (Nudges RSI :-)
Cheers
Peter Mason
|
|
|