Re: Passing arguments at runtime [message #31490] |
Thu, 25 July 2002 01:38  |
alt
Messages: 28 Registered: August 2001
|
Junior Member |
|
|
"Daniel Peduzzi" <peduzzi@attbi.com> wrote in message news:<aXV_8.127643
> 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.
I use the same technique of passing parameters via temporary file (in
contrast to environmental variable it allows any data passing
including IDL sav-files) and had the same synchronization problems.
Some my experience about:
* random number-based file name can be used instead of processID-based
file name as a unique name. It allows to deal with network
applications. (Besides I do not know how to get processID in Windows
;-))) File name length sets the fault probability.
* semaphore algorithms of synchronizations used in multithreading and
network collision avoidance can be used but they are rather
complicated if take into account all probable faults.
* time synchronization: for example: every minute - during first 20
sec processes writes their parameters under unique names; during next
20 sec dead space - processes are finishing their writing; last 20 sec
IDL main process or some daemon checks presence of the parameters,
read them, delete them and process them all.
* process create unique temporary directory, copy small IDL startup
module in it, write parameter file and run startup module which read
the parameters, restore main program, pass the parameters to it and
delete temporary directory.
Hope this will help,
Altyntsev Dmitriy
Remote Sensing Center, ISTP
Irkutsk, Russia
http://ckm.iszf.irk.ru
|
|
|