开发者

Advantages of Thread pooling in embedded systems

开发者 https://www.devze.com 2022-12-23 10:23 出处:网络
I am looking at the advantages开发者_如何学运维 of threadpooling design pattern in Embedded systems.

I am looking at the advantages开发者_如何学运维 of threadpooling design pattern in Embedded systems. I have listed few advantages, please go through them, comment and please suggest any other possible advantages that I am missing.

  1. Scalability in systems like ucos-2 where there is limit on number of threads.
  2. Increasing capability of any task when necessary like Garbage collection (say in normal systems if garbage collection is running under one task, its not possible to speed it up, but in threadpooling we can easily speed it up).
  3. Can set limit on the max system load.

Please suggest if I am missing anything.


Pooling also helps avoid nasty lower level leaks that can happen when you create and destroy threads. A certain unamed embedded OS likes to lose 4K everytime a thread dies(even after the process is destroyed). On this particular OS, it is impossible to have a long running system that makes threads frequently, that is unless you use thread pooling.


Thread creation/destruction may carry a large overhead and be non-deterministic. One time creation of a thread pool puts all this overhead up-front, and can improve performance by having threads ready to run at any time.

0

精彩评论

暂无评论...
验证码 换一张
取 消