[zeromq-dev] Questions
Martin Sustrik
sustrik at fastmq.com
Wed Nov 26 08:15:25 CET 2008
Hi Louis,
> I have recently found my way to the zeromq web-site and have been studying the API and the examples.
>
> Not everything is clear to me, so that is why I come here and post some questions:
>
> - It's my understanding that the threads that have to be associated with a poll_thread_t instance are there only for the purpose of dealing with IPC (between different processes). They do not serve a purpose when exchanging messages between an exchange and a queue inside the same process. Is this a correct view?
No. Opposite is true. If you are communicating within process you need
no poll_thread_t instance. poll_thread_t is used solely to interact with
the network layer. It gets data from you application threads and pushes
it to the socket. It retrieves data from the socket and hands it to your
application thread.
> - It's my understanding that the poll_thread_t instances are not counted as a thread in the sense of the number of threads supported by the dispatcher instance. Is this a correct view?
They are. So it you have 3 application threads + 2 poll threads you
should initialise dispatcher to 5 threads. Number of queues, exchanges
and bindings is irrelevant here.
> - It's my understanding that a thread associates itself with the dispatcher through the api_thread_t instance and that it is this association that counts in the sense of the number of threads supported by the dispatcher. Is this a correct view?
See above.
> - I'm having similar thoughts on the use of the threads associated with a binding as for the poll_thread_t. Is this a correct view?
See above.
> - Is it possible to have one thread listen to two or more queues queues?
Sure.
> - Is it possible to have one thread listen to a queue (or more see above) and also get woken-up when a fd has some work to be done (like a socket fd)?
This functionality is planned for. The infrastructure is in place and it
should require 1-2 days of work to get it in. If you want to speed this
up we are doing on-demand development commercially, so feel free to
contact us at desk at fastmq.com
> - Is it possible to get a notification when a binding is established, and if so is it possible to see which exchange is binding to what queue?
Same as above.
> - Is it possible to get a notification of a binding being broken, and if so is it possible to see which exchange is unbound from what queue?
This functionality is already present. Have a look at
"set_error_handler" function.
> Seeing the above it's quite a list already.
:)
Side note: The new version is coming out this/next week with more
operating systems (including Windows) supported - if that's of any
interest to you.
Regards.
Martin
More information about the zeromq-dev
mailing list