Hi Azat, Correct me if I'm wrong. But he is using std c++11 "libraries" which are cross platform. On the other hand, pthread is not cross platform.
So I think Michael shouldn't use pthreads and instead implement the callbacks (which is actually pretty straightforward). 10x, Tomer. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Azat Khuzhin Sent: Wednesday, March 16, 2016 1:54 AM To: [email protected] Cc: [email protected] Subject: Re: [Libevent-users] std::threads > >It's better to enable locking for bufferevents anyway. > > > Are you sure it is ok to lock the bufferevents by our own lock? No > need to implement these > (http://www.wangafu.net/~nickm/libevent-book/Ref1_libsetup.html > <http://www.wangafu.net/%7Enickm/libevent-book/Ref1_libsetup.html> > specifically that section about “Locks and threading”)??? > > How about event_base? lock event_base similar to bufferevents? I think that basic bufferevents locks must be enough (pthread on linux/some stuff on win32), since std::thread is not about this, IOW it is safe to synchronize via pthread's locks between them. *********************************************************************** To unsubscribe, send an e-mail to [email protected] with unsubscribe libevent-users in the body.
