[zeromq-dev] Mac OS X: test_shutdown_stress sometimes fails

Martin Sustrik sustrik at 250bpm.com
Fri Nov 19 18:21:00 CET 2010

On 11/19/2010 05:48 PM, Dhammika Pathirana wrote:

> -1 for auto buffer resizing.
> This is bound to go gaga anytime, and possibly has a remote trigger.
> Different option is to send cmd_t struct pointers. It'll give about
> 16K commands with 128K
> socket buffer. But this will require malloc'ing cmd_t structs, or we
> can use a ring.

That can be optimised. No problem. The hard part is synchronising the 
state of internal fds (mailbox_t) with the queue of command_t's in such 
a way when the fd is signals POLLIN iff there's a command in the queue.

Seems easy, but it's actually pretty hard. Maybe unsolvable? In any 
case, nasty race conditions tend to emerge. My feeling is we are getting 
to the edge of what can be done via POSIX API.

> But isn't it fair to drop/backlog new connections if the application
> can't keep up?

Won't help. You have the same problem with disconnections.


More information about the zeromq-dev mailing list