Re: Squid-2.6 comm_select_win32.c, time for a rewrite to new commloop structure?

From: Henrik Nordstrom <henrik@dont-contact.us>
Date: Sat, 28 Oct 2006 02:51:18 +0200

tis 2006-10-24 klockan 08:24 +0200 skrev Guido Serassio:

> Sure, but some oddity comes directly from Microsoft "features" .... :-)
> Windows select() is only similar to the Unix one ....

Sorted out the differences and whipped up a new comm_select_win32.c file
(untested). Please check if it works. It approaches the HANDLE -> fd
lookup more in line with normal FD_ISSET which should be slightly faster
as less data to loop over.

Also whipped up a comm_poll_win32.c file which in theory should work on
Vista/Longhorn and perform significantly better thanks to it's static
mappings allowing efficient HANDLE -> fd lookups.

Would be good if you could test the new comm_select_win32.c. And if
interested play with comm_poll_win32.c (but due to the OS dependencies
it's a bit early to deploy such builds I suppose..)

May also be interesting to look into using WSAAsyncSelect(), the win32
equivalence to kqueue/epoll with some edge/level twists. It's interface
looks like a quite good fit for our event loop, and allows for a trivial
HANDLE->fd mapping (just use the fd number as event message). But then
got a little lost as I am not familiar with how to handle Windows event
loops in non-windowed appliecations.. i.e. what window handle should be
given to WSAAsyncSelect? And where is the resulting window messages
received?

Regards
Henrik

Received on Fri Oct 27 2006 - 18:51:24 MDT

This archive was generated by hypermail pre-2.1.9 : Wed Nov 01 2006 - 12:00:06 MST