[zeromq-dev] Returning EINTR on interrupted non-blocking calls
Martin Sustrik
sustrik at 250bpm.com
Wed Nov 18 12:50:55 CET 2009
Matias,
I've implemented the EINTR thing, however, it turns out that it won't be
of much help in multithreaded environment - the signal is delivered to a
single thread, leaving other threads blocked in the blocking call :(
I'm not checking it in as it doesn't seem to be useful.
Martin
Subject:
Returning EINTR on interrupted non-blocking calls
From:
Matias GUIJARRO <matias.guijarro at esrf.fr>
Date:
Tue, 17 Nov 2009 10:26:13 +0100
To:
zeromq-dev-bounces at mail.imatix.com
I think it's a good idea. Much cleaner.
Thanks,
Matias.
Martin Sustrik wrote:
> Btw, I gave your example program a thought and my feeling is that the
best way to handle this kind of thing is to break non-blocking calls
(send, recv, poll) when signal arrives the same way that POSIX sockets
do, i.e. to return EINTR error code. That way you'd be able to check
whenther Ctrl+C have arrived and terminate your application neatly.
>
> Thoughts?
> Martin
More information about the zeromq-dev
mailing list