Andres Freund <andres@anarazel.de> writes:
> On January 2, 2016 6:28:10 PM GMT+01:00, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Indeed. It doesn't look like any of the cleanup I suggested in that
>> thread has ever gotten done. I suspect that we'll continue to see
>> problems until we get rid of the transient event object attachments.
> That'd address some of the problem, but that'd not address the edge triggered behaviour of FD-CLOSE. I think we'll
haveto abstract away windows sockets, and store the event & state there.
Right. What I wrote in the 2012 thread was
: More generally, it seems clear to me that Microsoft's code is designed
: around the assumption that an event object remains attached to a socket
: for the lifetime of the socket. This business of transiently associating
: event objects with sockets looks quite inefficient and is evidently
: triggering a lot of unpleasant corner-case behaviors. I wonder whether we
: should not try to make "pgsocket" encapsulate a socket and an associated
: event object as a single entity on Windows. (Such a struct would be a
: good place to keep a per-socket noblock flag, too.) I'm not going to
: tackle that myself though.
which I think is the same as what you're suggesting.
regards, tom lane