Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Ressource dispatcher

by jeepj (Scribe)
on Mar 10, 2008 at 09:18 UTC ( [id://673189]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://673189]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-26 03:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found