Re: Semaphores and Task Synchronization
Posted in 1995
On 14 Jun 1995, Robert Rubin wrote: > I'm looking for techniques to perform task synchronization > via a 6.0 or 7.1 Online Dynamic Server. If you weren't set on using the DB-Server you could write a locking server to be ran on a host... I seem to remmember of someone working on this a few years ago... You open a socket to the locking server (I think it was called SLS, Simple Locking Server) and send the character L followed by a slot id of the lock you wanted to grab. The server would then return a "Y" for yes you have the lock. When your done with the lock you would send a U followed by the slot id you locked... The server would only reply a "Y" when the slot was yours and locked (aka the other process unlocked it...). If there was an error you would receive an "N". If you attempted to unlock a slot that you didn't lock you would receive a "N". The slot id could be any combination of characters like "jon_slot_1" or "123456" or "may write to output file xxxxx.xxx". If for some reason your program died and the connection was lost it was assumed that you did want to hold the lock and the server would release it... When there was no pending requests for a given lock the server would delete the lock from internal memory. Pretty simple... I'll look tonight when I get home to see if I have the source code if you want... =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Jason Lambert Bass, Inc. CIX Support Analyst 2211 Arbor Blvd. (513) 293-5732 Dayton, Ohio jlambert@bassinc.com 45439 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=