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

Home » Public Forums » archive » SPAWN
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: spawn [message #18945 is a reply to message #8682] Wed, 16 February 2000 00:00 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
marc <m_schellens@hotmail.com> writes:

> I want to spawn under UNIX one program many times (multiprocessor
> machine). So I could sent it into the background using the UNIT keyword,
> but how can I determine when the program finishes?
> I run some basic tests and it seems that IDL leaves the unit open.
> Is there a way or have I (ab)use the filesystem for this (via
> lockfiles)?

A clarification is in order. SPAWN with the UNIT keyword does *not*
run the process in the background. The unit stays open because IDL
attaches the output of the process to the unit, and IDL is waiting for
you to read the output.

You can run the process in the background by adding '&' like you
normally would. Then be sure that you redirect the output and CLOSE
the unit.

To find out whether a background process is finished is difficult.
Usually it's just easiest to write a flag to a temporary file when the
job is done, and have IDL periodically monitor that file for changes.
One can probably do it with the unix system call waitpid(), but you
that would require compiling a DLM, not for the faint of heart.

Good luck,
Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: PSF Energy inside circle
Next Topic: Edge detection and convert edges into polygons

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

Current Time: Sat Oct 11 15:58:53 PDT 2025

Total time taken to generate the page: 0.72388 seconds