[zeromq-dev] concurrent test design - need advices

Pieter Hintjens ph at imatix.com
Thu Oct 10 18:15:23 CEST 2013


Hi Laurent,

You can't use zmutex in a libzmq test case... and in general I'd stay
away from using that in any code which people might plausibly take as
an example. It's a class that I regret making in CZMQ and sometimes
think of killing off.

Use ZeroMQ messages to synchronize the threads; control them from the
main function. You can easily synchronize N threads using a pub-sub
socket flow.

As for how many threads and messages... you do realize that there is
no real concurrency, right? It's all serialized, that is kind of the
beauty of ZMQ.

-Pieter



On Thu, Oct 10, 2013 at 5:55 PM, Laurent Alebarde <l.alebarde at free.fr> wrote:
> Hi Devs,
>
> I would like to add a concurrent test to libzmq.
>
> Objective : test multi-thread clients concurrent messaging send/receive from
> the same server.
>
> Design : use a mutex to synchronize every round of bursts. Each burst is a
> TBD number of messages. One burst of send, one of receive, all of it a few
> times. It will work as bounce i.e. the test program can use it with any type
> of socket.
>
> Questions :
>
> Is zmutex a good solution to synchronize the threads ?
> The doc shows an example of zmutex in the same function. How do I use it in
> a multithread environment, shall I pass the mutex to the threads as an
> argument ?
> If say the resolution is 1ms, how many 32 bytes messages shall I send in
> each burst to obtain concurrency for sure ?
> How many clients do you advise ?
>
> Cheers,
>
> Laurent.
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>



More information about the zeromq-dev mailing list