Re: [RFC] libpq extensions - followup

From: Iker <iker(at)ieee(dot)org>
To: pgsql-general(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: [RFC] libpq extensions - followup
Date: 2003-01-26 07:15:58
Message-ID: 00c101c2c50a$c707fed0$6401a8c0@KNUTH
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

BTW, the source tarball contains two example programs - an event-driven
version which demonstrates simulating multiple "in-flight" queries and a
multi-threaded version.

Cheers,
Iker

----- Original Message -----
From: "Iker Arizmendi" <iker(at)research(dot)att(dot)com>
Newsgroups:
comp.databases.postgresql.general,comp.databases.postgresql.questions
Sent: Sunday, January 26, 2003 2:02 AM
Subject: Re: [RFC] libpq extensions - followup

> Althought multiple queries can't be executed concurrently they can be
> queued up by a connection object. For instance:
>
> PGXquery* q1 = PQXcreateQuery(...);
> PGXquery* q2 = PQXcreateQuery(...);
> ...
> PGXquery* qN = PQXcreateQuery(...);
>
> PQXexecute(conn1, q1);
> PQXexecute(conn1, q2);
> ...
> PQXexecute(conn1, qN);
>
> while (1) { /* event loop code */ }
>
> In this example, queries q1 through qN are "in flight" simultaneously as
> far as the client is concerned even though the connection conn1 is
> really queueing them up. During execution of the event loop, the
> connection object manages the job of executing each query
> sequentially (which, with respect to the client, is an implementation
> detail).
>
> Cheers,
> Iker
>
> On Sun, 26 Jan 2003 00:47:20 -0500
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> > Iker Arizmendi <iker(at)research(dot)att(dot)com> writes:
> > > A while back I suggested that it would be useful if asynchronous
> > > connections could support multiple queries "in flight", especially
> > > if you're working on event driven applications (see topic "rfc -
> > > libpq extensions"). I've since started work on a simple library,
> >
> > I must be missing something fundamental here. The backend doesn't
> > support multiple parallel queries, so how can you have "multiple
> > queries in flight" on the same connection?
> >
> > regards, tom lane
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeffrey Melloy 2003-01-26 08:23:16 Re: Can object oriented table design help to solve this problem?
Previous Message Alan T. Miller 2003-01-26 07:05:58 Can object oriented table design help to solve this problem?