Re: [HACKERS] 'Waiting on lock' - Mailing list pgsql-patches

From Tom Lane
Subject Re: [HACKERS] 'Waiting on lock'
Date
Msg-id 7902.1182274324@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] 'Waiting on lock'  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-patches
Gregory Stark <stark@enterprisedb.com> writes:
> Attached is a patch which moves the messages to ProcSleep(). To do this I had
> to move the semaphore signal to unconditionally be signalled whenever
> CheckDeadLock() is called regardless of whether it finds a hard deadlock. I'm
> not 100% sure that's correct but afaik we only use semaphores to signal state
> changes and deal with spurious semaphore firings everywhere.

It's a bit itchy-seeming, but I think what you are actually doing is
going over to a regime where every wait on the semaphore checks and
re-waits if it didn't get the condition it wants.  Before, I think we
did that for every use of the semaphore except this one (which is an
outgrowth of the fact that originally this was indeed the only use of
the sema, and the others got shoehorned in over time).

I'll check it over.

            regards, tom lane

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] 'Waiting on lock'
Next
From: Michael Paesold
Date:
Subject: Re: WIP: rewrite numeric division