Re: Condition variable live lock - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Condition variable live lock
Date
Msg-id 15204.1515166090@sss.pgh.pa.us
Whole thread Raw
In response to Re: Condition variable live lock  (Thomas Munro <thomas.munro@enterprisedb.com>)
Responses Re: Condition variable live lock
List pgsql-hackers
Thomas Munro <thomas.munro@enterprisedb.com> writes:
> Could we install the sentinel and pop the first entry at the same
> time, so that we're not adding an extra spinlock acquire/release?

Hm, maybe.  Other ideas in that space:

* if queue is empty when we first acquire the spinlock, we don't
have to do anything at all.

* if queue is empty after we pop the first entry, we needn't bother
installing our sentinel, just signal that proc and we're done.

It's a question of how complicated you're willing to make this
logic, and whether you trust that we'll be able to test all the
code paths.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: pgsql: Implement channel binding tls-server-end-point for SCRAM
Next
From: Alvaro Herrera
Date:
Subject: Re: Failed to delete old ReorderBuffer spilled files