From: | Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> |
---|---|
To: | Thomas Munro <thomas(dot)munro(at)gmail(dot)com> |
Cc: | Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: pgbench with libevent? |
Date: | 2023-08-14 10:22:24 |
Message-ID: | eb36f089-98ca-6277-dbae-d8fb7c6ec585@mines-paristech.fr |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
>> 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.
From | Date | Subject | |
---|---|---|---|
Next Message | Fabien COELHO | 2023-08-14 10:32:33 | Re: pgbench with libevent? |
Previous Message | Fabien COELHO | 2023-08-14 10:09:52 | Re: pgbench with libevent? |