I haven't been able to find any good examples of using semaphores to handle locking.
I have a script that can be used by multiple users at once. Certain procedures should only be run be one user at a time (seralized, more or less). What I would like to do is use semaphores to communicate between instances of the script and block operations if annother instance holds a lock.
I know I could do this with a lock file, but I think using semaphores would be a cleaner and faster method.
Does anyone have a good example of this?
BTW: I'm using Solaris, so I do support System V IPC.
I have a script that can be used by multiple users at once. Certain procedures should only be run be one user at a time (seralized, more or less). What I would like to do is use semaphores to communicate between instances of the script and block operations if annother instance holds a lock.
I know I could do this with a lock file, but I think using semaphores would be a cleaner and faster method.
Does anyone have a good example of this?
BTW: I'm using Solaris, so I do support System V IPC.