On 05/20/2011 06:22 PM, Marko Mikulicic wrote:

> What if the library could be compiled or parameterized with a "debug"
> flag/envvar, which enables thread identity checks and issue a warning
> if a socket is being used by two different threads at runtime? Then
> there will be a canned response for everybody reporting issues (please
> enabled debugging and try again),
> and still have a fast default path.

In theory, each socket could be wrapped in critical section, each call 
would pthread_mutex_trylock() and assert with nice descriptive error 
message if the mutex is already locked.

However, this doesn't work if one thread closes the socket and other 
thread tries to access it afterwards.

Martin
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to