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

Home » Public Forums » archive » Passing arguments at runtime
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Passing arguments at runtime [message #31521] Mon, 22 July 2002 08:56
Daniel Peduzzi is currently offline  Daniel Peduzzi
Messages: 29
Registered: June 1999
Junior Member
My understanding is that the common (only?) method of passing parameters
to an IDL program, restored at runtime using the IDL -rt option, is to read them
from a temporary file (e.g. "input.dat".) I've been using this technique for years,
and it works well for cases where there is no chance of the same "sav" file being
restored by multiple processes.

However, dangers arise when multiple processes restore the same "sav"
file, since the uniquely-named "input.dat" file is in danger of being read
or changed by the wrong process.

As an example: I have a c-shell script which is kicked off whenever a data file
appears in a directory. This can happen several times per hour. The script
takes the data file name, writes it to the temporary "input.dat" file, and starts
the IDL program which reads the data file name from "input.dat" and immediately
deletes "input.dat".

To further protect against cases where the IDL program is restored by parallel
processes, I've tried to name the temporary file something unique, such as
"input.$$" (where $$ denotes the process ID). Within the IDL program, I get
the most recently created input.* file via SPAWN, 'ls -1t input.*'. But this can still
fail when 2 or more processes are started at the same time.

I was wondering how other folks have handled this situation, and if maybe
there are other solutions which are not file-based and therefore prone to
synchronization problems.

Dan

---------------------------------------
Daniel C. Peduzzi
peduzzi@attbi.com
---------------------------------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: CoolHelp update
Next Topic: widget_slider with odd integers

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

Current Time: Sat Oct 11 14:43:47 PDT 2025

Total time taken to generate the page: 1.76084 seconds