Re: Synchronization primitives (Was: Re: An example of bugs for Hot Standby)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Synchronization primitives (Was: Re: An example of bugs for Hot Standby)
Дата
Msg-id 16135.1264011365@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Synchronization primitives (Was: Re: An example of bugs for Hot Standby)  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Ответы Re: Synchronization primitives (Was: Re: An example of bugs for Hot Standby)  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список pgsql-hackers
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> Streaming Replication introduces a few places with a polling pattern
> like this (in pseudocode):

> while()
> {
>   /* Check if variable in shared has advanced beoynd X */
>   SpinLockAcquire()
>   localvar = sharedvar;
>   SpinLockRelease()
>   if (localvar > X)
>     break;

>   /* Not yet. Sleep
>   pg_usleep(100);
> }

I trust there's a CHECK_FOR_INTERRUPTS in there ...

> It would be nice to have a new synchronization primitive for that.

Maybe.  The lock, the variable, the comparison operation, and the sleep
time all seem rather specific to each application.  Not sure that it'd
really buy much to try to turn it into a generic subroutine.
        regards, tom lane


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Synchronization primitives (Was: Re: An example of bugs for Hot Standby)
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Synchronization primitives (Was: Re: An example of bugs for Hot Standby)