Re: bug in fast-path locking - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: bug in fast-path locking
Date
Msg-id 1334013132.5289.86.camel@sussancws0025
Whole thread Raw
In response to Re: bug in fast-path locking  (Jim Nasby <jim@nasby.net>)
Responses Re: bug in fast-path locking  (Jim Nasby <jim@nasby.net>)
List pgsql-hackers
On Mon, 2012-04-09 at 17:42 -0500, Jim Nasby wrote:
> Dumb question... should operations in the various StrongLock functions
> take place in a critical section? Or is that already ensure outside of
> these functions?

Do you mean CRITICAL_SECTION() in the postgres sense (that is, avoid
error paths by making all ERRORs into PANICs and preventing interrupts);
or the sense described here:
http://en.wikipedia.org/wiki/Critical_section ?

If you mean in the postgres sense, you'd have to hold the critical
section open from the time you incremented the strong lock count all the
way until you decremented it (which is normally at the time the lock is
released); which is a cure worse than the disease.

Regards,Jeff Davis




pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: bug in fast-path locking
Next
From: Robert Haas
Date:
Subject: Re: Last gasp