public inbox for [email protected]  
help / color / mirror / Atom feed
From: Fabien COELHO <[email protected]>
To: Thomas Munro <[email protected]>
Cc: Tatsuo Ishii <[email protected]>
Cc: PostgreSQL Developers <[email protected]>
Subject: Re: pgbench with libevent?
Date: Mon, 14 Aug 2023 12:22:24 +0200 (CEST)
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+hUKGJRD3p8rc8rf7fXcQqBQmOShEuwAZybpFC08+Rf7Y1nJw@mail.gmail.com>
References: <[email protected]>
	<[email protected]>
	<CA+hUKGK8St8+hJ1kb1fygEzNwgJunVyBL-+1pg-6W+JJPmOnyA@mail.gmail.com>
	<[email protected]>
	<CA+hUKGJRD3p8rc8rf7fXcQqBQmOShEuwAZybpFC08+Rf7Y1nJw@mail.gmail.com>


>> Interesting. In my understanding this also needs to make Latch
>> frontend-friendly?
>
> It could be refactored to support a different subset of event types --
> maybe just sockets, no latches and obviously no 'postmaster death'.
> But figuring out how to make latches work between threads might also
> be interesting for future projects...
>
> Maybe Fabien has completion-based I/O in mind (not just "readiness").

Pgbench is really a primitive client on top of libpq. ISTM that 
completion-based I/O would require to enhance libpq asynchronous-ity, not 
just expose its underlying fd to allow asynchronous implementations.
Currently pgbench only actuall "waits" for results from the server
and testing PQisBusy to check whether they are there.

> That's something that some of those libraries can do, IIUC.  For
> example, when your thread wakes up, it tells you "your socket read is
> finished, the data is already in your target buffer".

Indeed, libevent has a higher level "buffer" oriented API.

> As opposed to "you can now call recv() without blocking", so you avoid 
> another trip into the kernel.  But that's also something we'll 
> eventually want to figure out in the server.

-- 
Fabien.






view thread (7+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: pgbench with libevent?
  In-Reply-To: <[email protected]>

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

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