[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

RE: [Libevent-users] std::threads



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: owner-libevent-users@xxxxxxxxxxxxx [mailto:owner-libevent-users@xxxxxxxxxxxxx] On Behalf Of Azat Khuzhin
Sent: Wednesday, March 16, 2016 1:54 AM
To: libevent-users@xxxxxxxxxxxxx
Cc: libevent-users@xxxxxxxx
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 majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.