good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Sync item list between perl scripts, across serversby GrandFather (Saint) |
on Nov 14, 2016 at 09:06 UTC ( [id://1175866]=note: print w/replies, xml ) | Need Help?? |
A "regular file" isn't going to cut it for you. For such concurrent access to work and be robust at least each update to the file must be serialized to ensure the queue's integrity. There are several ways around the problem, but none are altogether trivial. Probably the easiest way to do it is to set up a transacted database to manage the queue. Even using transacted updates some care needs to be taken to ensure queue item insertion and removal are handled correctly.
Premature optimization is the root of all job security
In Section
Seekers of Perl Wisdom
|
|