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

From: Markus Wanner <markus(at)bluegap(dot)ch>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Magnus Hagander <magnus(at)hagander(dot)net>
Subject: Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)
Date: 2010-09-09 08:34:42
Message-ID: 4C889C22.8060709@bluegap.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2010-09-09 11:57:41 Re: string function - "format" function proposal
Previous Message Markus Wanner 2010-09-09 08:17:18 Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)