in reply to Ressource dispatcher
If so, consider keeping track of the used sessions with locks on some OS resource - like a file. When the process holding the lock exits, the lock will automatically be released. Otherwise this is very similar to the database approach except that you would query the status of the sessions via the OS with commands like fuser and lsof instead of using SQL.
Another possibility is to use the advisory locking feature provided for by mysql. It allows you to 'lock' an arbitrary string, and the lock will be released when the database connection is closed.
I would first explore solutions where you don't have to write your own daemon. This will mean that mean that you'll be putting the session acquisition code in your perl scripts, and scripts which are waiting to run will have to periodically poll the pool of sessions for a free session, but it's easy to implement, and it might work well enough.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Ressource dispatcher
by jeepj (Scribe) on Mar 10, 2008 at 09:18 UTC |