[zeromq-dev] Application design. Overcomplicated?
Ilja Golshtein
ilejncs at yandex.ru
Mon Apr 18 09:56:56 CEST 2011
Hello Pieter,
I've filled the gap and had a look at the asynsrc example.
You are right and it addresses start/stop multithread issues.
I am not familiar with libzapi, so a couple of questions if you don't mind.
There is zlist_push call in zctx__socket_new without any mutex or something. The consideration is if it is safe to call zsocket_new from different threads as we can see in server_worker method in asyncsrv.c. My feeling is these threads use the same zctx_t. Is it wrong?
In zthread.c zctx_thread_new method is mentioned, though I failed to find it. Is it renamed?
What is there behind server_task and client_task termination? Is client_task and server_task epilogue epilogue with zctx_destroy really meaningful having in mind infinite loop above?
What is your attitude towards libzapi in C++?
My zapi version is 2c1bd38bfd1220226c04c03a39a28e62adf4c631
Many thanks.
08.04.2011, 12:07, "Pieter Hintjens" <ph at imatix.com>:
> 2011/4/8 Ilja Golshtein <ilejncs at narod.ru>;:
>
>> It would be nice to create a generic Unix 0mq based multithread C application design.
>> A sort of best practice.
>
> Have you seen the asyncsrv example?
> http://zguide.zeromq.org/page:all#Asynchronous-Client-Server
>
> Maybe you could tell me what's missing from that, it seems to already
> cover most of what you're asking for.
>
> -Pieter
--
Best regards,
Ilja Golshtein.
More information about the zeromq-dev
mailing list