Chuchi,
This is the concept:
File: LOCK.QUEUE
Program: ACQUIRE.LOCK - which asks the Phantom to lock an item by
putting the details in the LOCK.QUEUE file.
SUBROUTINE
ACQUIRE.LOCK(FileName,ItemName,SomeIdentifierForRequestingProcess)
* Comments
GOSUB OPEN.FILES ;* Open files you'll need to get started (i.e. LOCK.QUEUE)
GOSUB INIT.VARS ;* Set up variables, like PORT.NO
LQ.REC = 'ACQUIRE'
LQ.REC<2> = FileName
LQ.REC<3> = ItemName
LQ.REC<4> = SomeIdentifierForRequestingProcess
LQ.ID = DATE():'*':TIME():'*':PORT.NO
WRITE LQ.REC on LQ.FILE, LQ.ID
STOP
* Subroutines go here
Program: RELEASE.LOCK - which asks the Phantom to unlock an item
by putting the details in the LOCK.QUEUE file.
Code is the same as above, except send 'RELEASE' instead of 'ACQUIRE'
Program: READ.THROUGH.LOCK - which asks the Phantom to read the
locked item by putting the details in the LOCK.QUEUE file.
Code is the same as above, except you send 'READ' and add a variable to
return the data.
The phantom itself is just a Loop/Read LQ.REC/Do
Acquire-Release-Read/Repeat. Anymore specific than this and I'd have to
charge you for writing it.
- Chuck
chuchi wrote:
Thanks all for your answer.
I understand the issue, one phantom process only for lock management.
But i don't know how to create and communicate with this phantom
process.
- Charles Barouch
[EMAIL PROTECTED]
(718) 762-3884 x 1
P. O. Box 540957,
Linden Hill, NY 11354-0957
www.KeyAlly.com
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/