Re: [Libevent-users] Integrate Windows I/O Completion Port into Libevent

2008-06-04 Thread liusifan
Hi, >The integrate strategy for IOCP and WSAEventSelect is not safe. >Because WSARecv/WSASend will sets the state of the event object to nonsignaled. >This can lead to a race condition: >1.the first WSARecv/WSASend operations have completed, hEvent is signaled >2.the second WSARecv/WSASend has bee

Re: [Libevent-users] Integrate Windows I/O Completion Port into Libevent

2008-06-04 Thread liusifan
Hi, >>3. How to integrate these two mechanism ? >>When we issue a WSARecv or WSASend, we need to pass a OVERLAPPED structure. >>This structure has a hEvent member. >>We could use one event for all WSARecv/WSASend. http://msdn.microsoft.com/en-us/library/ms686358(VS.85).aspx Synchronization and O

Re: [Libevent-users] Integrate Windows I/O Completion Port into Libevent

2008-06-03 Thread liusifan
Mostly test cases of regress.c are passed. These are some changes since the libevent-1.4.4-iocp.zip Please check the diff file as attachment. The following test cases are failure or cann't be compiled. I will pay more time to get these test cases to pass. test_bufferevent_watermarks(); fail, b

Re: [Libevent-users] Integrate Windows I/O Completion Port into Libevent

2008-06-02 Thread lau stephen
2008/6/2, Nick Mathewson <[EMAIL PROTECTED]>: > > On Sun, Jun 01, 2008 at 01:51:53PM +0800, liusifan wrote: > [...] > > This seems pretty promising, and could wind up being a better > short-term idea than our older plan to get IOCP support by making it a > new backend for bufferevents. > > How well

Re: [Libevent-users] Integrate Windows I/O Completion Port into Libevent

2008-06-02 Thread Aleksandar Lazic
Hi William, On Mon 02.06.2008 12:30, William Ahern wrote: I'm writing a kqueue(2) compat library, and AIO support is next on my list. http://software.schmorp.de/pkg/libeio.html what do you think about this lib, looks quite nice for me? Cheers Aleks _

Re: [Libevent-users] Integrate Windows I/O Completion Port into Libevent

2008-06-02 Thread William Ahern
On Mon, Jun 02, 2008 at 11:35:58AM -0400, Nick Mathewson wrote: > On Sun, Jun 01, 2008 at 01:51:53PM +0800, liusifan wrote: > [...] > > Integrate Windows I/O Completion Port into Libevent > > > > IOCP is true async i/o model, and libevent is event-driven i/o model. > I'm curious, how close are I

Re: [Libevent-users] Integrate Windows I/O Completion Port into Libevent

2008-06-02 Thread Nick Mathewson
On Sun, Jun 01, 2008 at 01:51:53PM +0800, liusifan wrote: [...] > Integrate Windows I/O Completion Port into Libevent > > IOCP is true async i/o model, and libevent is event-driven i/o model. > > 1. How to emulate event-driven recv/send ? > It is possible to use IOCP to emulate event-driven mode