Answer the question
In order to leave comments, you need to log in
What happens when a new thread is created?
Everywhere they say that this is an expensive operation. Why? What is happening at this moment? And why does it take so long?
Answer the question
In order to leave comments, you need to log in
The OS allocates memory for structures describing the thread, allocates the thread stack, and adds the thread to the scheduler.
All this takes both CPU time and memory, so every thread is not free. Much or little time/memory is, of course, relative. Concerning those tasks which the flow will solve.
Rave.
Most processors now support Hyper-Threading: X cores = 2X threads. Therefore, do not use the power, forcing them to stand idle - I do not see it as rational.
Reading for understanding.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question