X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6264A5288E for ; Sat, 28 May 2005 23:04:53 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 01966-06 for ; Sun, 29 May 2005 02:04:46 +0000 (GMT) Received: from svr2.postgresql.org (svr2.postgresql.org [65.19.161.25]) by svr1.postgresql.org (Postfix) with ESMTP id 66F2752956 for ; Sat, 28 May 2005 23:04:35 -0300 (ADT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.196]) by svr2.postgresql.org (Postfix) with ESMTP id 18882F0D8B for ; Sat, 28 May 2005 21:31:49 +0100 (BST) Received: by wproxy.gmail.com with SMTP id 68so1173170wri for ; Sat, 28 May 2005 13:34:20 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=NMjj/7rne7wy4JG4aVrGEaXbxaDUHr9iG3cPq7lhcnt4bRENTQs29zlnhNCgJ3szyD45JbjLDlFSQDccrNsCbZ0cFWrfGrrEzA8ESF8cogqMNe06T2+2kdU/GD/DacK18MnWInrjov6GdP239EZKyW/Swmv62yeH80h3fBy33II= Received: by 10.54.26.62 with SMTP id 62mr1666132wrz; Sat, 28 May 2005 13:34:20 -0700 (PDT) Received: by 10.54.30.45 with HTTP; Sat, 28 May 2005 13:34:20 -0700 (PDT) Message-ID: <7104a737050528133410045f04@mail.gmail.com> Date: Sat, 28 May 2005 23:34:20 +0300 From: Volkan YAZICI Reply-To: Volkan YAZICI To: PostgreSQL Interfaces Subject: libpq, blocking/nonblocking mechanism Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.374 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200505/61 X-Sequence-Number: 5564 Hi, While I'm trying to figure out the point of PQsetnonblocking() call, confused so much on blocking/nonblocking mechanism. Sync. Connect =BB Async. Query Async. Connect =BB Sync. Query Both of above flows work without any PQsetnonblocking() call. Therefore sync/async connection and sync/async query execution are not dependent to each other. (Right?) If so, what's the point of PQsetnonblocking() function? When do we require it and when should we use it? As I saw from src/interfaces/libpq/fe-exec.c, PQsetnonblocking() only assigns True or False to conn->nonblocking variable. When I searched for "->nonblocking" under libpq directory, I found that it's used while creating an empty PGconn and while closing PGconn. This didn't help me too. I'd be so appreciated for a comprehensive "specialized for dummies" answer. Regards. P.S. Documentation pointers will be accepted with pleasure too.