-
It is mentioned on the api docs that block_in_place() turns a core thread into a blocking thread. I have a question about this: the default number of core threads is the number of CPU cores. If I use block_in_place(), will it reduce the number of core threads? Will call block_in_place() frequently cause core threads unavailable? Or maybe that every time a core thread becomes a blocking thread, a new core thread will be added to keep the number of core threads consistent with the number of CPU cores? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Whenever you use |
Beta Was this translation helpful? Give feedback.
Whenever you use
block_in_place
, the runtime will start a new worker thread usingspawn_blocking
so the number of worker threads remains constant unless thespawn_blocking
queue is full, preventing the new worker thread from starting.