Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Database queue logic

by trammell (Priest)
on Jun 14, 2005 at 20:20 UTC ( [id://466689]=note: print w/replies, xml ) Need Help??


in reply to Database queue logic

I'd use something like the following:
# pseudocode while (1) { acquire_lock(); # blocks choose_record(); # choose an unflagged record flag_record(); # this one is mine release_lock(); # let others in process_record(); # do work }

MySQL has "advisory" locking that is suitable for this (see MySQL functions GET_LOCK() and RELEASE_LOCK()).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-19 13:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found