Confirmed. Creating more than 10 contexts triggers "bonzai" tree rebuild with incorrect parameters. Fixed in commit 274b96/package 1.4.5.77.
I am wondering however why you were calling init in a loop - was it simply to test capabilities? Each program should create a context exactly once at start-up and terminate it on exit, as outlined in the guide (http://zguide.zeromq.org/page:all#Getting-the-Context-Right).
The current tracking implementation assumes the cumulative number of contexts is small and will probably become quite inefficient if there is a high turnover without stopping (e.g. in a loop). I intend to improve it when I have time.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That is not how ZeroMQ is designed, whether he likes it or not. Create and disregard sockets for every message, sure, but you're not supposed to expend contexts.
Currently every context created by the application is tracked in a data structure until it finishes. This is what provides the cleanup mechanism and interrupt support. It could be improved but I considered reliability more important than efficiency at the time.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The test code is at
https://crocket-slackbuilds.googlecode.com/files/labview2010-zmq-context-test.vi
Confirmed. Creating more than 10 contexts triggers "bonzai" tree rebuild with incorrect parameters. Fixed in commit 274b96/package 1.4.5.77.
I am wondering however why you were calling init in a loop - was it simply to test capabilities? Each program should create a context exactly once at start-up and terminate it on exit, as outlined in the guide (http://zguide.zeromq.org/page:all#Getting-the-Context-Right).
The current tracking implementation assumes the cumulative number of contexts is small and will probably become quite inefficient if there is a high turnover without stopping (e.g. in a loop). I intend to improve it when I have time.
My coworker doesn't like it when he has to initialize when an application starts and terminate when it ends.
He wants to initialize and terminate it whenever a VI sends a message.
Such a message is converted to an SMS message.
That is not how ZeroMQ is designed, whether he likes it or not. Create and disregard sockets for every message, sure, but you're not supposed to expend contexts.
Currently every context created by the application is tracked in a data structure until it finishes. This is what provides the cleanup mechanism and interrupt support. It could be improved but I considered reliability more important than efficiency at the time.
I overhauled the context tracking algorithm, which should now be much more efficient. Tested in v1.4.5.79
Thanks for your effort. I'll test it soon.