@Roger: to avoid some confusion:
- the attached patch does not depend on pthread. The suggestion here is merely to use evutil_socketpair instead of pipe.
- evutil_socketpair is part of libevent 1.4 on ubuntu 10.10, although I did not test it.
All the other changes related to win32 in the attached patch attached are not to take literally (Winsock2.h, static cast...).
- my understanding is that
THRIFT-1031 does not support async/libevent server on Windows (??)
- libevent+thrift server seems VERY fast on win, and is needed for my project (blocking server won't do)
- APR was not strictly necessary for the Non-Blocking server win32 port (i.e. libevent+pthread-win32), although I tried the
THRIFT-1031 patch and observed it made the port a bit cleaner, so I would not refrain from adding APR to thrift-C++
I decided after reviewing the win32 patches, it was better to open a separate issue, since the change here is atomic and should bare little consequences on linux. I was hoping that (naively) the win32 delta would get smaller by using the compatible call.
All that said, I'd be really happy to contribute to
THRIFT-1031 for it to go through. For this to happen, I would hope to have access to a shared implementation on top of 0.6.1 (the way I provided it on github), so I can test it regularly. Let me know if I can contribute somehow!
As a conclusion, I think this patch is somewhat unrelated to
THRIFT-1031, but it will help a future port of the NB server on win32 (assuming also someone will replace the pthread dependency by boost, which does not seem trivial at all).