[Openais] [LCK] exec/lck.c lock_algorithm question

Pascal Bouchareine pascal at gandi.net
Thu Sep 13 15:03:24 PDT 2007


Hi all,

I'm new to this and try to read the whole stuff right now.

I'm having problems using the LCK service and got confused
by the lock_algorithm of exec/lck.c:

if ex lock granted
    if ex pending list has locks
        send waiter notification to ex lock granted
else
    (..)

And the following :
{
    ..
    if (resource->ex_granted) {
        /*
         * Exclusive lock granted
         */
        if (resource_lock->lock_mode == SA_LCK_PR_LOCK_MODE) {
            lock_queue (resource, resource_lock);
        }
    } else {
        ..
    }
}

When one process holds an exclusive lock on the ressource,
the next one to EX_LOCK is not notified since it's not
added to the wait list, and hangs.

Replacing the ex_granted case with an unconditionnal lock_queue,
disregarding the requested lock_mode, I get a better behaviour,
but is this the correct one ?

Thanks,
Pascal

-- 
\o/   Pascal Bouchareine - Gandi 
 g    0170393757           15, place de la Nation - 75011 Paris      


More information about the Openais mailing list