Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id CE1E2475A3F; Sat, 18 Jan 2003 10:09:51 -0500 (EST) Received: from cornelius-olsen.dk (0x50c4f773.arcnxx7.adsl-dhcp.tele.dk [80.196.247.115]) by postgresql.org (Postfix) with ESMTP id ECDD3474E5C; Sat, 18 Jan 2003 10:09:50 -0500 (EST) To: pgsql-general@postgresql.org, pgsql-interfaces@postgresql.org Subject: libpq C library Client Interface - select() MIME-Version: 1.0 X-Mailer: Lotus Notes Release 5.0.9 November 16, 2001 Message-ID: From: jco@cornelius-olsen.dk Date: Sat, 18 Jan 2003 16:08:52 +0100 X-MIMETrack: Serialize by Router on sonic/cgroup(Release 5.0.11 |July 24, 2002) at 01/18/2003 04:08:54 PM, Serialize complete at 01/18/2003 04:08:54 PM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/689 X-Sequence-Number: 35810 Hi, Several places in the docs references something called "select()". One=20 example: A better way to check for NOTIFY messages when you have no useful queries= =20 to make is to call PQconsumeInput(), then check PQnotifies(). You can use s= elect() to wait for backend data to arrive, thereby using no CPU power unle= ss=20 there is something to do. (See PQsocket() to obtain the file descriptor num= ber to use with select().)=20 My problem is that I can find no information on what "select()" is or how= =20 it's used. Does anyone have any pointers? My particular interest is that I'd like to find out how to do modify the=20 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=F8rn