Re: Simplify sleeping while reading/writing from client

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Simplify sleeping while reading/writing from client
Дата
Msg-id 54D48D59.1040602@vmware.com
обсуждение исходный текст
Ответ на Re: Simplify sleeping while reading/writing from client  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: Simplify sleeping while reading/writing from client  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
On 02/06/2015 10:38 AM, Michael Paquier wrote:
> On Thu, Feb 5, 2015 at 6:45 PM, Heikki Linnakangas wrote:
>> Looking again at the code after Andres' interrupt-handling patch series, I
>> got confused by the fact that there are several wait-retry loops in
>> different layers, and reading and writing works slightly differently.
>>
>> I propose the attached, which pulls all the wait-retry logic up to
>> secure_read() and secure_write(). This makes the code a lot more
>> understandable.
>
> Are you sure that it is a good idea to move the check of port->noblock
> out of be_tls_[read|write] to an upper level? ISTM that we should set
> errno and n to respectively EWOULDBLOCK and -1 in be_tls_[write|read]
> when port->noblock and do nothing otherwise. In your patch those
> values are set even if the port is in block mode.

It simplifies the code to do all the sleeping and interrupt handling 
code in the upper level, in secure_[read|write]. Do you see a problem 
with it?

- Heikki




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andreas Karlsson
Дата:
Сообщение: Re: PATCH: Reducing lock strength of trigger and foreign key DDL
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Simplify sleeping while reading/writing from client