Re: [zeromq-dev] How many messages are in queue now?

2015-04-17 Thread Pieter Hintjens
It was never possible, due to the fact that pipes are being written and read asynchronously. You cannot measure the free space except by stopping everything. The workaround is to use credit based flow control. I've a section in the Guide that explains how this works. You can in effect know what %

Re: [zeromq-dev] How many messages are in queue now?

2015-04-17 Thread Ilja Golshtein
Hello Pieter, thank you for your answer. I am in process of reading http://zguide.zeromq.org/hx:chapter7 , while atomic counter seems more natural choice for inproc so far. Could you please explain why it is possible to detect that we are at 100% of HWM and it is not possible to detect that

Re: [zeromq-dev] How many messages are in queue now?

2015-04-17 Thread Thomas Rodgers
At the point a message is placed on the queue it is either at HWM or has at least space for one message, this can be evaluated atomically, claiming the 'slot' under the HWM for the message to be placed on the queue. Any other threads attempting to send would synchronize with this operation and the

Re: [zeromq-dev] How many messages are in queue now?

2015-04-17 Thread Ilja Golshtein
Thomas, Agree that it makes perfect sense for multiple producers and consumers, while in my case it is ZMQ_PAIR. Thanks. 17.04.2015, 16:49, "Thomas Rodgers" rodg...@twrodgers.com:At the point a message is placed on the queue it is either at HWM or has at least space for one message, this can be

Re: [zeromq-dev] How many messages are in queue now?

2015-04-17 Thread Ilja Golshtein
Yes, this is true. If a sysadmin detects that a disk storage is 90% full, she notifies users and do other things to obtain more room, while it is quite possible that the disk is only 89% full at the moment.So, ability to calculate disk usage is "a likely source of confusion and gnashing of

Re: [zeromq-dev] How many messages are in queue now?

2015-04-17 Thread Thomas Rodgers
Patches welcome. On Friday, April 17, 2015, Ilja Golshtein ilej...@narod.ru wrote: Yes, this is true. If a sysadmin detects that a disk storage is 90% full, she notifies users and do other things to obtain more room, while it is quite possible that the disk is only 89% full at the moment.

Re: [zeromq-dev] How many messages are in queue now?

2015-04-17 Thread Pieter Hintjens
... On Fri, Apr 17, 2015 at 5:12 PM, Thomas Rodgers rodg...@twrodgers.com wrote: Patches welcome. On Friday, April 17, 2015, Ilja Golshtein ilej...@narod.ru wrote: Yes, this is true. If a sysadmin detects that a disk storage is 90% full, she notifies users and do other things to obtain

Re: [zeromq-dev] How many messages are in queue now?

2015-04-17 Thread Steve Eley
On Apr 17, 2015, at 10:00 AM, Ilja Golshtein ilej...@narod.ru wrote: Agree that it makes perfect sense for multiple producers and consumers, while in my case it is ZMQ_PAIR. Simple solution for your use case: Add an incrementing serial number to each of your outgoing messages. The sending