You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "alexandre parenteau (JIRA)" <ji...@apache.org> on 2011/09/26 02:15:26 UTC

[jira] [Created] (THRIFT-1361) Optional replacement of pthread by boost::thread

Optional replacement of pthread by boost::thread
------------------------------------------------

                 Key: THRIFT-1361
                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
             Project: Thrift
          Issue Type: Improvement
          Components: C++ - Library
    Affects Versions: 0.8
         Environment: Linux and Windows
            Reporter: alexandre parenteau
            Priority: Minor
             Fix For: 0.8


What it is:

* an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
* a way for thrift clients already depending on boost::thread to blend better with thrift
* a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.

What it is NOT:

* a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
* a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform

New dependencies:

* if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"

Bugs/Testing:

* ./TestServer --server-type=thread-pool: PASS
* ./TestServer --server-type=threaded: PASS
* TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
* Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
 * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies

Related JIRA:

* THRIFT-1031: Windows port

Side notes:

* there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
* TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
* a minor fix in TSocket.cpp prevents verbose error, WIN32 only
* minor enhancement by using WSAPoll if available, WIN32 only
* on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:

{code}
index 31d108f..42aa227 100644
--- a/boost/interprocess/detail/move.hpp
+++ b/boost/interprocess/detail/move.hpp
@@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
 #else
 template <class T> inline
 typename remove_reference<T>::type&& move(T&& t)
-{  return t;   }
+{  return static_cast<typename remove_reference<T>::type &&>(t);   }
 #endif
{code}

Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Commented] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13144988#comment-13144988 ] 

Hudson commented on THRIFT-1361:
--------------------------------

Integrated in Thrift #319 (See [https://builds.apache.org/job/Thrift/319/])
    THRIFT-1361 Optional replacement of pthread by boost::thread
Patch: Alexandre Parenteau
rev3

roger : http://svn.apache.org/viewvc/?view=rev&rev=1198339
Files : 
* /thrift/trunk/compiler/cpp/src/thrifty.yy
* /thrift/trunk/configure.ac
* /thrift/trunk/lib/cpp/Makefile.am
* /thrift/trunk/lib/cpp/src/concurrency/BoostMonitor.cpp
* /thrift/trunk/lib/cpp/src/concurrency/BoostMutex.cpp
* /thrift/trunk/lib/cpp/src/transport/TSSLSocket.cpp
* /thrift/trunk/lib/cpp/test/Makefile.am

                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Assignee: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361-rev2.patch, THRIFT-1361-rev3.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Resolved] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "Roger Meier (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roger Meier resolved THRIFT-1361.
---------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 0.9)
                   0.8
         Assignee: alexandre parenteau

looks good for 0.8 committed
                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Assignee: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361-rev2.patch, THRIFT-1361-rev3.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Updated] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "alexandre parenteau (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

alexandre parenteau updated THRIFT-1361:
----------------------------------------

    Attachment: THRIFT-1361-rev3.patch

New improved patch will fix a couple of recently introduced problems in the trunk, when --enable-boost-thread is enabled.

Tested on Ubuntu/Win, using Boost 1.42/1.44/1.47

Note: In my mind it is still fine to have this patch included in 0.9 only, however I'll note this patch is probably safe for 0.8 as well, if times allow (only cosmetic changes, and the slightly bigger changes are only affecting the optional and new --enable-boost-thread)
                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.9
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361-rev2.patch, THRIFT-1361-rev3.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Commented] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "Roger Meier (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13118990#comment-13118990 ] 

Roger Meier commented on THRIFT-1361:
-------------------------------------

committed!
                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Resolved] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "Roger Meier (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roger Meier resolved THRIFT-1361.
---------------------------------

    Resolution: Fixed
      Assignee: alexandre parenteau
    
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Assignee: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Commented] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "Roger Meier (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13130386#comment-13130386 ] 

Roger Meier commented on THRIFT-1361:
-------------------------------------

sorry!

also with the mutex.hpp header i have the following error with boost 1.42

{noformat}
make[4]: Entering directory `thrift/lib/cpp'
/bin/bash ../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../..  -I/usr/include -I./src  -Wall -g -O2 -MT BoostMutex.lo -MD -MP -MF .deps/BoostMutex.Tpo -c -o BoostMutex.lo `test -f 'src/concurrency/BoostMutex.cpp' || echo './'`src/concurrency/BoostMutex.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../.. -I/usr/include -I./src -Wall -g -O2 -MT BoostMutex.lo -MD -MP -MF .deps/BoostMutex.Tpo -c src/concurrency/BoostMutex.cpp  -fPIC -DPIC -o .libs/BoostMutex.o
src/concurrency/BoostMutex.cpp: In member function âvirtual bool apache::thrift::concurrency::Mutex::timedlock(int64_t) constâ:
src/concurrency/BoostMutex.cpp:49: error: âclass apache::thrift::concurrency::Mutex::implâ has no member named âtimed_lockâ

{noformat}


                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361-rev2.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

       

[jira] [Commented] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "Paul Chen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13116010#comment-13116010 ] 

Paul Chen commented on THRIFT-1361:
-----------------------------------

@alexandre First off, a big thank you for supplying this patch. My question is how do I go about applying the patch on windows? I got the trunk of thrift, applied this patch, and ran "./bootstrap.sh" and then "./configure --enable-boostthreads" under cygwin. However, I'm running into this issue:

./configure: line 16881: syntax error near unexpected token `GLIB,'
./configure: line 16881: `  PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.0, have_glib2=
yes, have_glib2=no)'

Obviously, I'm doing something wrong. ;-)

                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Commented] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "Peace C (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13123730#comment-13123730 ] 

Peace C commented on THRIFT-1361:
---------------------------------

I have uploaded a patch for the MSVC projects to build with Alex's Boost threads. See THRIFT-1387.
                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Assignee: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Assigned] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "alexandre parenteau (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

alexandre parenteau reassigned THRIFT-1361:
-------------------------------------------

    Assignee:     (was: alexandre parenteau)
    
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361-rev2.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Resolved] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "Roger Meier (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roger Meier resolved THRIFT-1361.
---------------------------------

    Resolution: Fixed
      Assignee: alexandre parenteau

Thanks Alexandré!

committed with one exception

lib/cpp/src/concurrency/BoostMutex.cpp is unmodified

it did not compile properly on Debian Squeeze
                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Assignee: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361-rev2.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

       

[jira] [Commented] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13130094#comment-13130094 ] 

Hudson commented on THRIFT-1361:
--------------------------------

Integrated in Thrift #300 (See [https://builds.apache.org/job/Thrift/300/])
    THRIFT-1361 Optional replacement of pthread by boost::thread
Patch: Alexandre Parenteau

Remark: lib/cpp/src/concurrency/BoostMutex.cpp is unmodified

roger : http://svn.apache.org/viewvc/?view=rev&rev=1185904
Files : 
* /thrift/trunk/.gitignore
* /thrift/trunk/lib/cpp/libthrift.vcxproj
* /thrift/trunk/lib/cpp/libthriftnb.vcxproj
* /thrift/trunk/lib/cpp/src/concurrency/BoostMonitor.cpp

                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Assignee: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361-rev2.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Commented] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13119001#comment-13119001 ] 

Hudson commented on THRIFT-1361:
--------------------------------

Integrated in Thrift #288 (See [https://builds.apache.org/job/Thrift/288/])
    THRIFT-1361 Optional replacement of pthread by boost::thread
Patch: alexandre parenteau

roger : http://svn.apache.org/viewvc/?view=rev&rev=1178176
Files : 
* /thrift/trunk/.gitignore
* /thrift/trunk/configure.ac
* /thrift/trunk/lib/cpp/Makefile.am
* /thrift/trunk/lib/cpp/src/concurrency/BoostMonitor.cpp
* /thrift/trunk/lib/cpp/src/concurrency/BoostMutex.cpp
* /thrift/trunk/lib/cpp/src/concurrency/BoostThreadFactory.cpp
* /thrift/trunk/lib/cpp/src/concurrency/BoostThreadFactory.h
* /thrift/trunk/lib/cpp/src/concurrency/Mutex.h
* /thrift/trunk/lib/cpp/src/concurrency/PlatformThreadFactory.h
* /thrift/trunk/lib/cpp/src/concurrency/PosixThreadFactory.cpp
* /thrift/trunk/lib/cpp/src/concurrency/Thread.h
* /thrift/trunk/lib/cpp/src/concurrency/test/ThreadFactoryTests.h
* /thrift/trunk/lib/cpp/src/concurrency/test/ThreadManagerTests.h
* /thrift/trunk/lib/cpp/src/concurrency/test/TimerManagerTests.h
* /thrift/trunk/lib/cpp/src/server/TThreadedServer.cpp
* /thrift/trunk/lib/cpp/src/transport/TFDTransport.cpp
* /thrift/trunk/lib/cpp/src/transport/TFileTransport.cpp
* /thrift/trunk/lib/cpp/src/transport/TFileTransport.h
* /thrift/trunk/lib/cpp/src/transport/TSocket.cpp
* /thrift/trunk/lib/cpp/src/windows/config.h
* /thrift/trunk/test/cpp/Makefile.am
* /thrift/trunk/test/cpp/src/StressTest.cpp
* /thrift/trunk/test/cpp/src/StressTestNonBlocking.cpp
* /thrift/trunk/test/cpp/src/TestClient.cpp
* /thrift/trunk/test/cpp/src/TestServer.cpp
* /thrift/trunk/test/threads/ThreadsClient.cpp
* /thrift/trunk/test/threads/ThreadsServer.cpp

                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Assignee: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Commented] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "alexandre parenteau (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13132128#comment-13132128 ] 

alexandre parenteau commented on THRIFT-1361:
---------------------------------------------

@Roger: Thanks for the detailed infos: I tried to fix the patch with Boost 1.0.42, but not to prevail. I'd suggest to defer the bug to 0.9 (or something of this nature), since the last patch it is not strictly necessary for the overall feature to work. Thanks!
                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361-rev2.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Commented] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "Roger Meier (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13130500#comment-13130500 ] 

Roger Meier commented on THRIFT-1361:
-------------------------------------

revert latest changes on lib/cpp/src/concurrency/BoostMonitor.cpp

                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361-rev2.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Updated] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "Jake Farrell (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jake Farrell updated THRIFT-1361:
---------------------------------

    Fix Version/s:     (was: 0.8)
                   0.9
    
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.9
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361-rev2.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Commented] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13119574#comment-13119574 ] 

Hudson commented on THRIFT-1361:
--------------------------------

Integrated in Thrift #289 (See [https://builds.apache.org/job/Thrift/289/])
    THRIFT-1361 Optional replacement of pthread by boost::thread (minor fix)
FIX: member initialization order within constructor

roger : http://svn.apache.org/viewvc/?view=rev&rev=1178532
Files : 
* /thrift/trunk/lib/cpp/src/transport/TFileTransport.cpp

                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Assignee: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Commented] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13144994#comment-13144994 ] 

Hudson commented on THRIFT-1361:
--------------------------------

Integrated in Thrift #320 (See [https://builds.apache.org/job/Thrift/320/])
    THRIFT-1361 revert compiler/cpp/src/thrifty.yy change
=> breaks mingw build
=> memleak fixes reported by cppcheck

roger : http://svn.apache.org/viewvc/?view=rev&rev=1198347
Files : 
* /thrift/trunk/compiler/cpp/src/thrifty.yy
* /thrift/trunk/lib/cpp/src/transport/TFileTransport.cpp
* /thrift/trunk/lib/cpp/test/TransportTest.cpp

                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Assignee: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361-rev2.patch, THRIFT-1361-rev3.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Updated] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "alexandre parenteau (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

alexandre parenteau updated THRIFT-1361:
----------------------------------------

    Attachment: THRIFT-1361-rev2.patch

Use boost mutex, instead of boost multiprocess (simpler), remove remaining pthread for Win32
                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Assignee: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361-rev2.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Issue Comment Edited] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "alexandre parenteau (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13130098#comment-13130098 ] 

alexandre parenteau edited comment on THRIFT-1361 at 10/18/11 10:52 PM:
------------------------------------------------------------------------

@Roger: huh, this is bad, as a partial integration will seg fault, see BoostMonitor.cpp which does a cast of a boost::mutex.

It would be *highly* preferable instead to *not* include the BoostMonitor.cpp change, as both are inter-dependent.

Alternatively, I don't know what is the compiler error on Debian, but it may very well be missing the include inside BoostMutex.cpp:

{code}
#include <boost/thread/mutex.hpp>
{code}

Thanks!
                
      was (Author: aubonbeurre):
    @Roger: huh, this is bad, as a partial integration will seg fault, see BoostMonitor.cpp which does a cast of a boost::mutex.

It would be *highly* preferable also to *not* include the BoostMonitor.cpp change, as both are inter-dependent.

Alternatively, I don't know what is the compiler error on Debian, but it may very well be a missing the include inside BoostMutex.cpp:

{code}
#include <boost/thread/mutex.hpp>
{code}

Thanks!
                  
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361-rev2.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Updated] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "alexandre parenteau (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

alexandre parenteau updated THRIFT-1361:
----------------------------------------

    Attachment: THRIFT-1361-configure.ac.patch

@roger: thanks for finding out about the missing patch: please find the missing patch for configure.ac attached.
                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Commented] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "alexandre parenteau (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13130098#comment-13130098 ] 

alexandre parenteau commented on THRIFT-1361:
---------------------------------------------

@Roger: huh, this is bad, as a partial integration will seg fault, see BoostMonitor.cpp which does a cast of a boost::mutex.

It would be *highly* preferable also to *not* include the BoostMonitor.cpp change, as both are inter-dependent.

Alternatively, I don't know what is the compiler error on Debian, but it may very well be a missing the include inside BoostMutex.cpp:

{code}
#include <boost/thread/mutex.hpp>
{code}

Thanks!
                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Assignee: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361-rev2.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Commented] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13130472#comment-13130472 ] 

Hudson commented on THRIFT-1361:
--------------------------------

Integrated in Thrift #301 (See [https://builds.apache.org/job/Thrift/301/])
    THRIFT-1361 Optional replacement of pthread by boost::thread
revert boost changes

roger : http://svn.apache.org/viewvc/?view=rev&rev=1186049
Files : 
* /thrift/trunk/lib/cpp/src/concurrency/BoostMonitor.cpp

                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361-rev2.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Commented] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "alexandre parenteau (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13116510#comment-13116510 ] 

alexandre parenteau commented on THRIFT-1361:
---------------------------------------------

@Paul: sorry for not being clearer, this patch is to be testing the boost::thread replacement on Linux. I have however a pre-patched version for Windows of this patch on a github branch, but it requires MSVC 10: https://github.com/aubonbeurre/thrift/blob/winthriftnb-0.8.x-3/README.non.blocking.Windows. Assuming this patch would go in, Thrift Windows would have it too, per virtue of THRIFT-1031
                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Commented] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "Paul Chen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13116640#comment-13116640 ] 

Paul Chen commented on THRIFT-1361:
-----------------------------------

@alexandre I've been following your non.blocking stuff since about 0.6.0, but the readme says it depends on pthread-win32. I am looking to build a windows server without requiring pthread-win32. I guess I can try to manually apply this patch to winthritfnb-0.8.x-3?
                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Updated] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "alexandre parenteau (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

alexandre parenteau updated THRIFT-1361:
----------------------------------------

    Attachment: THRIFT-1361.patch

Optional and experimental --enable-boostthreads, replace direct usage of POSIX thread

> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Reopened] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "alexandre parenteau (Reopened) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

alexandre parenteau reopened THRIFT-1361:
-----------------------------------------

      Assignee:     (was: alexandre parenteau)
    
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361-rev2.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Reopened] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "alexandre parenteau (Reopened) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

alexandre parenteau reopened THRIFT-1361:
-----------------------------------------


@Roger: thanks for your continuing help! I have a few corrections, which I attached inside THRIFT-1361-rev2.patch.

- remove remaining pthread traces in MSVC projects
- use boost mutex, instead of boost multiprocess (simpler)

                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Assignee: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361-configure.ac.patch, THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Commented] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "Roger Meier (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13118307#comment-13118307 ] 

Roger Meier commented on THRIFT-1361:
-------------------------------------

Alexandre, good idea! I like boost!
Can you please provide configure.ac option for this feature?
Thanks
-roger
                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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

        

[jira] [Commented] (THRIFT-1361) Optional replacement of pthread by boost::thread

Posted by "Paul Chen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13116862#comment-13116862 ] 

Paul Chen commented on THRIFT-1361:
-----------------------------------

Ok, README.non.blocking.Windows is wrong in that it doesn't require pthread-win32. ;-)
                
> Optional replacement of pthread by boost::thread
> ------------------------------------------------
>
>                 Key: THRIFT-1361
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1361
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Linux and Windows
>            Reporter: alexandre parenteau
>            Priority: Minor
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: THRIFT-1361.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> What it is:
> * an experimental alternative to using pthread in Thrift, by using boost::thread and boost::interprocess instead (--enable-boostthreads)
> * a way for thrift clients already depending on boost::thread to blend better with thrift
> * a solution to the Windows problem of having to link with ASF incompatible license of pthread_win32 (GPL), add more servers and transports to WIN32 (pooled, file, pipe...), and allow for a 64bits WIN32. See THRIFT-1031 for details.
> What it is NOT:
> * a replacement for the POSIX thread version of thrift: the POSIX pthread version has more features, and is probably more stable/mature. This feature is turned off by default by configure
> * a mature code: it has been really lightly tested, and is aimed primarily at the WIN32 platform
> New dependencies:
> * if --enable-boostthreads is provided, libthrift.so will link with shared libboost_thread.so (cannot work with libboost_thread.a AFAIK). This forces in effect Thrift to use a version of boost compiled with "./bjam link=shared"
> Bugs/Testing:
> * ./TestServer --server-type=thread-pool: PASS
> * ./TestServer --server-type=threaded: PASS
> * TFileTransportTest::test_destructor: FAILS: could not tell whether this is because I'm using a slow (virtual) machine (as pointed by the test comment)
> * Tested on Ubuntu/Windows, boost 1.44, libevent 2.0.14: however did not change the vc10 project files, because of potential conflict with on going THRIFT-1031
>  * It is now possible to include more servers/transports to Win32, and also remove all pthread_win32 dependencies
> Related JIRA:
> * THRIFT-1031: Windows port
> Side notes:
> * there are minor corrections inside PosixThreadFactory for all platforms ("started" vs "starting"...), so that Win32 port also works with pthread_win32
> * TFileTransport has been enhanced to use the existing Mutex and Monitor abstractions
> * a minor fix in TSocket.cpp prevents verbose error, WIN32 only
> * minor enhancement by using WSAPoll if available, WIN32 only
> * on msvc10 and boost 1.44, there is a problem deep inside boost::interprocess: boost/interprocess/detail/move.hpp needs to be patched:
> {code}
> index 31d108f..42aa227 100644
> --- a/boost/interprocess/detail/move.hpp
> +++ b/boost/interprocess/detail/move.hpp
> @@ -339,7 +339,7 @@ rvalue_reference move (input_reference);
>  #else
>  template <class T> inline
>  typename remove_reference<T>::type&& move(T&& t)
> -{  return t;   }
> +{  return static_cast<typename remove_reference<T>::type &&>(t);   }
>  #endif
> {code}
> Please let me know of any questions, testing help appreciated (./configure --enable-boostthreads). This is an important change for our company, to get a Windows port of Thrift more on par with Linux features.

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