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

Home » Public Forums » archive » Parallel Processing
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: Parallel Processing [message #80714 is a reply to message #80624] Thu, 05 July 2012 08:13 Go to previous messageGo to previous message
Lajos Foldy is currently offline  Lajos Foldy
Messages: 176
Registered: December 2011
Senior Member
On Thursday, July 5, 2012 4:52:23 PM UTC+2, Stefan wrote:
> Hi
>
> Now that I have successfully implemented multi-threading another problem occured:
>
> To invoke multiple processes I start in a loop with
>
> bridges[i]->EXECUTE, 'program,par1,par2', /NOWAIT
>
> where 'bridges' is an object-array which holds the different child processes.
> Upon the execution of the last process I do
>
> bridges[i]->EXECUTE, 'program,par3,par4'
>
> And after that I destroy my bridges in a loop.
>
> Now I have a problem if the last process finishes before one of the previous processes since upon its completion it will directly move to the part where all bridges are destroyed and kills my program...
>
> Is there an easy way to tell IDL to wait for all my processes to finish and then destroy the bridges?
>
> thanks
> Stefan

Use IDL_IDLBridge::Status to determine whether the job is finished. Pseudocode:

ndone=0
running=replicate(1, njobs)
while ndone lt njobs begin
for j=0,njobs-1 do begin
if running[j] then begin
query status of the j-th job with IDL_IDLBridge::Status
if finished
destroy bridge
running[j]=0
ndone++
endif
endif
endfor
wait, 1
endwhile


regards,
Lajos
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Upgrade IDL
Next Topic: Function graphics equivalent of !X.OMARGIN?

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

Current Time: Wed Oct 08 15:27:47 PDT 2025

Total time taken to generate the page: 0.00459 seconds