# 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()).
In reply to Re: Database queue logic
by trammell
in thread Database queue logic
by Marcello
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |