[ https://issues.apache.org/jira/browse/THRIFT-1031?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13118208#comment-13118208 ]
Peace edited comment on THRIFT-1031 at 9/30/11 5:20 PM: -------------------------------------------------------- Terrific work gents! I'm very glad to see James' and Alexandre's patches merged. Adding MSVC support will really speed up Thrift adoption. I'm able to build and run a Windows sample project that I've created based on Alexandre's sample in his fork over on github. There is one issue when running against the trunk (SVN 1177082). Using a ThreadManager causes an exception in PosixThreadFactory.cpp (pthread_attr_setschedpolicy @ line 121). Here's a code snippit: boost::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory()); boost::shared_ptr<MyHandler> handler(new MyHandler()); boost::shared_ptr<TProcessor> processor(new MyProcessor(handler)); boost::shared_ptr threadManager = ThreadManager::newSimpleThreadManager(NumThreads); boost::shared_ptr threadFactory = boost::shared_ptr (new PosixThreadFactory()); threadManager->threadFactory(threadFactory); threadManager->start(); // <-- exception here TNonblockingServer server(processor, protocolFactory, Port, threadManager); server.serve(); The exception occurs within the threadManager->start() call. This worked with Alexandre's fork but I haven't been able to determine why it's failing with the newly merged code in the trunk (SVN 1177082). Am I doing something wrong or does the current thrift code not support using ThreadManager this way? was (Author: peace): Terrific work gents! I'm very glad to see James' and Alexandre's patches merged. Adding MSVC support will really speed up Thrift adoption. I'm able to build and run a Windows sample project that I've created based on Alexandre's sample in his fork over on github. There is one issue when running against the trunk. Using a ThreadManager causes an exception in PosixThreadFactory.cpp (pthread_attr_setschedpolicy @ line 121). Here's a code snippit: boost::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory()); boost::shared_ptr<MyHandler> handler(new MyHandler()); boost::shared_ptr<TProcessor> processor(new MyProcessor(handler)); boost::shared_ptr threadManager = ThreadManager::newSimpleThreadManager(NumThreads); boost::shared_ptr threadFactory = boost::shared_ptr (new PosixThreadFactory()); threadManager->threadFactory(threadFactory); threadManager->start(); // <-- exception here TNonblockingServer server(processor, protocolFactory, Port, threadManager); server.serve(); The exception occurs within the threadManager->start() call. This worked with Alexandre's fork but I haven't been able to determine why it's failing with the newly merged code in the trunk (SVN 1177082). Am I doing something wrong or does the current thrift code not support using ThreadManager this way? > Patch to compile Thrift for vc++ 9.0 and 10.0 > --------------------------------------------- > > Key: THRIFT-1031 > URL: https://issues.apache.org/jira/browse/THRIFT-1031 > Project: Thrift > Issue Type: Improvement > Components: C++ - Library > Environment: Windows XP 32bit, vc++ 9.0, 10.0 > Reporter: James Dickson > Assignee: Roger Meier > Priority: Trivial > Fix For: 0.8 > > Attachments: thrift_msvc.patch, thrift_msvc_v0_1.patch, > thrift_msvc_v0_2.patch, thrift_msvc_v0_3.patch, thrift_msvc_v0_4.patch, > thrift_msvc_v0_5.patch, thrift_msvc_v0_6.patch, thrift_msvc_v0_7.patch > > > At our company we need clients running on Windows being able to connect to > our linux servers running hypertable. The attached patch enables the parts > needed by Hypertable to be compiled on Windows using either the VC++ 9.0 or > 10.0 compilers. > Having read previous posts about ports using boost::asio we found these to be > too intrusive for our needs. This version uses pthreads_win32 and winsock2 > and is as designed to be as un-intrusive as is possible to the original unix > code base. It is mostly #defines between unix sockets and winsock2 sockets. > We also tried to follow the folder structuring of the C# runtime that has > visual studio solutions to be consistent. > More details are in the README as not all the functionality of the original > unix code base is available to windows users. We will add the missing > functionality, we just wanted to share what we had as for a Windows based > client for us it is sufficient. > The patch is based on the latest revision in SVN, we would love feedback and > any code reviews. If there is any possibility of this being added to the main > trunk then that would be much appreciated, however we don't expect that. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira