[ 
https://issues.apache.org/jira/browse/THRIFT-1217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13054500#comment-13054500
 ] 

alexandre parenteau commented on THRIFT-1217:
---------------------------------------------

@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...).

About THRIFT-1031:

- 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).


> Use evutil_socketpair instead of pipe (Windows port)
> ----------------------------------------------------
>
>                 Key: THRIFT-1217
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1217
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.6.1, 0.7
>         Environment: Windows C++ 9.0, 10.0
>            Reporter: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.7
>
>         Attachments: evutil_socketpair.txt
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> As part of an effort to use the Non-Blocking server (using libevent) on 
> Windows, it was necessary to remove the use of "pipe" for the notification 
> mechanism to signal end-of-task. We propose to use evutil_socketpair instead 
> (tested with libevent 2.0.12). Patch included. Please see 
> https://github.com/aubonbeurre/thrift/blob/alex-0.6.1/README.non.blocking.Windows
>  for more details.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to