Re: [Mailman-Developers] about qrunner and locking

Hi Chuq,
here's another way that should work: each record has a locking field in it. When qrunner wants to execute that item, it reads the field. If the field is NULL, it writes its ID (hwatever it is, guaranteed unique) into that locking field. It then waits a beat, and reads it back. if it reads back its own ID, it knows it owns the record and can execute it. If it reads back someone else's ID, it lost the lock, but someone else owns the record so it can skip it and move on.
Sorry if this is wandering a little off topic, but what's a `beat'? What stops
A reads, gets NULL
B reads, gets NULL
A writes `A'
A waits a beat
A reads `A' and has the lock
B held up for a little writes `B'
B waits a beat
B reads `B' and also has the lock
I think I'm missing something and that's annoying :-)
Ralph.

At 11:16 PM +0000 12/8/00, Ralph Corderoy wrote:
Sorry if this is wandering a little off topic, but what's a `beat'? What stops
A writes `A' A waits a beat
A short wait. Just long enough to let things settle so you get reliable data. It's really a musical term that's I've absconded with...
participants (2)
-
Chuq Von Rospach
-
Ralph Corderoy