[Mailman-Developers] about qrunner and locking

Ralph Corderoy ralph@inputplus.demon.co.uk
Fri, 08 Dec 2000 23:16:23 +0000


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.