in reply to Re: Ressource dispatcher
in thread Ressource dispatcher
Thank you Corion and pc88mxer, I considered both solutions, and finally decided to go for a file locking mechanism.
The code is done in a common library, thus easily maintained, and this avoid the writing of a daemon. I am using the flock() function.
Furthermore, the resource consumption is quite high when 15 or 20 scripts are running in parallel, so avoiding the database approach was a better solution (even if SQLite is quite low on memory and CPU usage).
The persistence aspect, to know which script is running on a given session, is kept by the library: when a script requires a session, the function giving the lock is also printing in the file the name of the script, and the timestamp.
|
|---|