[nanomsg] Re: [**EXTERNAL**] Re: nng - reducing number of threads created by nni_taskq_sys_init

  • From: "da Silva Filho, Josias Inacio" <jdasilva@xxxxxxxxx>
  • To: "nanomsg@xxxxxxxxxxxxx" <nanomsg@xxxxxxxxxxxxx>
  • Date: Fri, 25 May 2018 19:36:18 +0000

Good to know, thanks Garrett.

Regards,
Josias

From: nanomsg-bounce@xxxxxxxxxxxxx [mailto:nanomsg-bounce@xxxxxxxxxxxxx] On ;
Behalf Of Garrett D'Amore
Sent: Friday, May 25, 2018 1:44 PM
To: nanomsg@xxxxxxxxxxxxx
Subject: [**EXTERNAL**] [nanomsg] Re: nng - reducing number of threads created 
by nni_taskq_sys_init

It should be fine.  I would be cautious about reducing below 4 - in particular 
some tasks may need a minimum level of concurrency to avoid a livelock 
condition when tearing down resources.

On Fri, May 25, 2018, 10:28 AM da Silva Filho, Josias Inacio 
<jdasilva@xxxxxxxxx<mailto:jdasilva@xxxxxxxxx>> wrote:
My team have noticed that currently nni_taskq_sys_init() is starting 16 threads:
https://github.com/nanomsg/nng/blob/846c30081a67e961b4a060bdca192ddafb87cce9/src/core/taskq.c#L241

Even when the code changes in the future to use NCPUs * 2, that would still be 
8 threads in our 4-core processor.

Would there be any significant performance impact if we reduced the number of 
threads to 2 or 4 to limit resources usage?

Regards,
Josias

Other related posts:

  • » [nanomsg] Re: [**EXTERNAL**] Re: nng - reducing number of threads created by nni_taskq_sys_init - da Silva Filho, Josias Inacio