Re: spawn issue - was: open sockets [message #53103 is a reply to message #53097] |
Wed, 21 March 2007 06:39   |
Bringfried Stecklum
Messages: 75 Registered: January 1996
|
Member |
|
|
Dear Lajos,
thanks for your suggestion which, however, seems to require to run two
programs in parallel, the main loop and the checking procedure. Since I
don't know how to do that I found another solution. It is based on the
unit and pid numbers provided by the procedure which calls ds9. Within
the main loop a test is invoked when the number of units in use exceeds
a certain number (25). The test checks for the existence of defunct
instances of ds9 (these are the ones which were terminated by closing
the window/exiting). If there are none the main loop has to wait until
ds9 windows will be closed by the user. Otherwise the units of those
pids which are defunct will be deallocated and their unit/pid numbers
removed from the bookkeeping pool of units/pids. Now I can inspect one
image after the other...
regards,
Bringfried
F�LDY Lajos wrote:
>
> On Tue, 20 Mar 2007, Bringfried Stecklum wrote:
>
>> It is clear now that the issue is unrelated to socket but in fact caused
>> by multiple calls to spawn each of which opens a pipe to transfer the
>> data like
>>
>> spawn,'ds9 stdin',unit=unit
>> writefits,'/dev/null',image,header,unit=unit
>>
>> The problem is that after closing ds9 the pipe is still open. It seems
>> there is no way to make IDL aware that the child process no longer
>> exists.
>>
>
> If you use the exit button in ds9, the pipe will remain open. You should
> call 'FREE_LUN, unit' to exit ds9 (and close the pipe).
>
> If you have multiple ds9 windows, you can add titles to them, and record
> the title-unit pairs, and write a little procedure to find the unit
> number belonging to the title, and call FREE_LUN for it.
>
> regards,
> lajos
>
|
|
|