A question about process and thread #6533
Replies: 2 comments 1 reply
-
Hello @zuoyanzhang, Typically HPX spawns its worker threads (by default one per CPU core) when the HPX runtime is initialized. These are OS threads (ie "pthreads" on Linux) and their number stays constant for the duration of the program. The number of worker threads and how they correspond to CPU cores can be controlled by various command line options. After that, no more OS threads or processes need to be created, as all parallelism and asynchrony within HPX are done using the HPX lightweight threads, which can be large in number, and are distributed among the existing OS worker threads. For example, parallel/asynchronous algorithms, hpx::thread, and hpx::futures all utilize lightweight threads. In addition, a developer using HPX should use the Thanks for your question and let me know if anything is unclear |
Beta Was this translation helpful? Give feedback.
-
Hi @Pansysk75 , |
Beta Was this translation helpful? Give feedback.
-
Hi, HPX Team, I want to know when and in what scenarios HPX will use processes and create processes, or whether it always uses lightweight threads. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions