Re: Can I have multiple threads in IDL? [message #40373 is a reply to message #40363] |
Sun, 08 August 2004 15:16   |
Peter Mason
Messages: 145 Registered: June 1996
|
Senior Member |
|
|
Marc Reinig wrote:
> We're currently running a very large computational program on a
> multiprocessor machine. When the FFT portion runs, the CPU load on
> all 8 processors spikes, so IDL is making use of them, life is good.
>
> However, we have another portion of the code that dose a massive
> nested loop on some arrays, but the operation is carried out on a
> very small subset of the array and IDL uses only a single processor.
> It could be easily broken into threads if we were writing in C to
> allow the OS (Windows Server 2003) to run the threads simultaneously.
>
> We would like to break this processing into multiple threads in IDL
> so that the task can be run on the other 7 processors in a similar
> manner. Is there a way to create and run a thread in IDL?
There is nothing about IDL itself that will stop you from writing threaded
external code. If you can write a CALL_EXTERNAL or DLM module and you can
write threaded code in C then you're set. OTOH, there is nothing in IDL
that will assist you here. IDL's internal threading system is not
available to external code. (Last I looked anyway.) You have to figure
out how best to divide up the work into chunks and you have to do all your
own thread creation and management in your C module. IMO, the first part
is usually the hard part. The second part is usually pretty
straightforward for a dedicated computational module; trivial, in fact, if
you have designed things so that your threads "keep off one another's turf".
Peter Mason
|
|
|