[zeromq-dev] HWM ignored on inproc connection

Martin Sustrik sustrik at 250bpm.com
Tue Jan 4 18:52:38 CET 2011

Hi Douglas,

> Here's an updated patch:

+        int64_t  hwm = options.hwm + peer->options.hwm;
+        int64_t  swap = options.swap + peer->options.swap;

The problem with the above is that the peer may be running in a 
different thread, thus you cannot use the pointer directly (lest you end 
up with race conditions).

That's why I suggested to place the HWM into context's endpoint map (see 
ctx_t::register_endpoint()). The map is guarded by mutex, thus, the HWM 
would be transferred safely.


More information about the zeromq-dev mailing list