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

[Libevent-users] bufferevent openssl deadlock



Hello,

About a year ago, there was a thread about deadlocking in bufferevent_openssl in multi-threaded mode (http://archives.seul.org/libevent/users/Jan-2011/msg00019.html).

We've run into the same problem.

Our minimal fix (as opposed to the patch mentioned, which adds atomic operations to evthread) for our specific use case was this :
- expose event_base_lock() and event_base_unlock() to library users
- in the user code make sure to lock the event_base before writing to an openssl bufferevent, so no callbacks can be fired during that write (which results in a deadlock).

Does anybody have feedback on better ways to workaround this?

Hi Nick, would you mind sharing the changes you had in mind?

Thanks,
Amarin