| От | jco@cornelius-olsen.dk |
|---|---|
| Тема | libpq C library Client Interface - select() |
| Дата | |
| Msg-id | OFE0A20DB5.46EB5199-ONC1256CB2.00532607@dk обсуждение исходный текст |
| Список | pgsql-general |
Hi,
Several places in the docs references something called "select()". One
example:
A better way to check for NOTIFY messages when you have no useful queries
to make is to call PQconsumeInput(), then check PQnotifies(). You can use select() to wait for backend data to arrive,
therebyusing no CPU power unless
there is something to do. (See PQsocket() to obtain the file descriptor number to use with select().)
My problem is that I can find no information on what "select()" is or how
it's used. Does anyone have any pointers?
My particular interest is that I'd like to find out how to do modify the
test program "testlibpq2.c" to use "select()" as suggested in the comments:
/*
* wait a little bit between checks; waiting with select()
* would be more efficient.
*/
Thanks in advance.
/Jørn
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера