Perl-Sensitive Sunglasses | |
PerlMonks |
Re^2: Ressource dispatcherby jeepj (Scribe) |
on Mar 10, 2008 at 09:18 UTC ( [id://673189]=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|