If this is the approach you go for, I would recommend that you use a resource lock, rather than a record lock (no need to open file etc etc)... Resource locks are set system wide, so are not limited to a single account / file / record, and are accessed with the LOCK/UNLOCK UniBasic commands... You have 64 locks to use as you see fit..
In my mind the solution depends on how quickly you need the second process to "wake up".. if a 30sec+ delay is ok, then using a resource lock could be an option with a SLEEP 30 on the locked condition.. Otherwise I would be looking at launching the "child" job as required, rather than having it wait for work.. Regards Raymond de Bourbon ________________________________________ From: owner-u2-us...@listserver.u2ug.org [owner-u2-us...@listserver.u2ug.org] On Behalf Of kishor [kis...@parmars.com] Sent: 26 February 2009 07:52 To: u2-users@listserver.u2ug.org Subject: RE: [U2] Inter-Process Control... Couldn't you get the second phantom to lock an empty record & release it when it is done? The first phantom can wait on the readu lock. Regards, Kishor Parmar -----Original Message----- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2-us...@listserver.u2ug.org] On Behalf Of Tom Whitmore Sent: 26 February 2009 12:57 To: u2-users@listserver.u2ug.org Subject: [U2] Inter-Process Control... We have two phantom processes. The first phantom needs to wait for an event to occur with the second phantom. I realize that I could have the first phantom loop, check, then sleep. However, I'd like to avoid wasting resources. Back on the Prime, I could use semaphores, to control this flow and this was clean, and simple. Has anyone come across a means of having a phantom wait on "something", so it only wakes up when it needs to perform its function? To try to explain better: Phantom1: Loop Wait on semaphore Perform a shared process (batch updates would be an example) Repeat Phantom2 (3, 4, ...): Loop Process records Notify semaphore Repeat Thanks, Tom Whitmore RATEX Business Solutions ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/