Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!) - Mailing list pgsql-hackers

From Markus Wanner
Subject Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)
Date
Msg-id 4C889C22.8060709@bluegap.ch
Whole thread Raw
In response to Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
On 09/08/2010 08:01 PM, Heikki Linnakangas wrote:
> Yeah, there isn't much you can do about it. Perhaps you could set a
> "mayday flag" (a global boolean variable) if it fails, and check that in
> the main loop, elogging a warning there instead. But I don't think we
> need to go to such lengths, realistically the write() will never fail or
> you have bigger problems.

Hm.. I think I'd like to see such a mayday flag. Just so we at least 
have a chance of finding out that something has gone wrong - whether or 
not there's a bigger problem.

> Perhaps, although it should be very rare to have more than one byte in
> the pipe. SetLatch doesn't write another byte if the latch is already
> set, so you only get multiple bytes in the pipe if many processes set
> the latch at the same instant.

Depending on what you use these latches for, it might not be that rare 
anymore. Trying to read more than one byte at a time doesn't cost anything.

Regards

Markus


pgsql-hackers by date:

Previous
From: Markus Wanner
Date:
Subject: Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)
Next
From: Pavel Stehule
Date:
Subject: Re: string function - "format" function proposal