Best way to start a thread as a member of a C++ class?

前端 未结 5 1150
一整个雨季
一整个雨季 2020-12-05 05:33

I\'m wondering the best way to start a pthread that is a member of a C++ class? My own approach follows as an answer...

5条回答
  •  执笔经年
    2020-12-05 06:04

    I have used three of the methods outlined above. When I first used threading in c++ I used static member functions, then friend functions and finally the BOOST libraries. Currently I prefer BOOST. Over the past several years I've become quite the BOOST bigot.

    BOOST is to C++ as CPAN is to Perl. :)

提交回复
热议问题