pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: jco@cornelius-olsen.dk
To: pgsql-interfaces@postgresql.org
Subject: libpq C library Client Interface - select()
Date: Sat, 18 Jan 2003 15:01:53 +0100
Message-ID: <OFAA501CC3.124DA424-ONC1256CB2.004C1580@dk> (raw)

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, thereby using 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



view thread (4+ messages)  latest in thread

Message-ID: <OFAA501CC3.124DA424-ONC1256CB2.004C1580@dk>
Permalink:  ../OFAA501CC3.124DA424-ONC1256CB2.004C1580@dk/
Also on:    postgresql.org/message-id/OFAA501CC3.124DA424-ONC1256CB2.004C1580@dk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: jco@cornelius-olsen.dk
  Subject: Re: libpq C library Client Interface - select()
  In-Reply-To: <OFAA501CC3.124DA424-ONC1256CB2.004C1580@dk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox