7 Aug
2006
7 Aug
'06
12:52 p.m.
Ovanes Markarian wrote:
What I miss now in the threading library is the ability to reuse the thread. I think thread creation in the OS is an expensive task. If one has created thread, there should be a possiblity to reuse it. I understand it is possible to pass a function to the thread which executes tasks from the queue and therefore reuses threads, but this involves user implementation of such a function each time this programming pattern needs to be fullfilled.
If I remember correctly thread creation in Solaris at least is cheap and Sun's developer manuals explicitly recommend creating threads as needed rather than pooling them. I'm not sure about other OSes. It might be worth checking before designing such a pool. John.