How to control threads generated by eCAL pub/sub? #971
-
From what I observe my C++ program using eCAL as middleware creates lots of threads. This is not really desireable on lower range CPU like embedded quad-core ARM. With a couple of publisher and subscriber open, i could get tens of threads running, by observing Is there a way to control of this behaviour? To limit the thread generated by eCAL within one process. I tried search on the config, but only thread-related ones are for TCP only, not SHM / inproc I also found some information here, but nothing on limiting the number of threads. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
It seems that every subscriber I opened on eCAL node, would create 2 threads. Are they:
|
Beta Was this translation helpful? Give feedback.
-
Hi @chengguizi, like described on the threading model documentation page, there are some global threads for an eCAL node. The whole UDP handling (monitoring/registration, payload receiving and sending and logging) is done globally and creating a few threads. For a single subscriber there is one additional thread per managed memory file, if you use the shared memory layer - default number of files is 1. Unfortunately there is no configuration option to reduce the number of threads. You could for sure switch of the shared memory layer and use udp for local connections too. But this will decrease the performance for larger payloads remarkable. |
Beta Was this translation helpful? Give feedback.
Yes.