I've been following the Semaphore Idea thread with great anticipation of an
acceptable solution - but....
It seems to me all of the responses suppose the process (task) doing the
locking will remain active until it can 'undo' the lock. I need something
that will 'go away' if the task or system crashes. I'm pretty new to Unix
but it seems to be the locking mechanisms mentioned so far would remain in
place in the event of a task or system crash.
On other platforms things like inter-task message ports, little chunks of
memory that can be grabbed or tested or with a file sharing mechanism such as
DOS SHARE, a file can be opened in output mode and another task would fail on a
an open or scratch.
Surely something like that exists on the Unix platform and ksh. My problem is
further compounded (I think) in that the contending tasks can be in foreground
I thought if background tasks were submitted with identifying dummy parms I
could use ps -ef | grep whatever to solve the problem but I dunno what I'd do
about the foreground (user) tasks.