문제

If I call task.wait() inside a thread that is managed by the thread pool, is that thread handed back to the thread pool so that it can be reused elsewhere while waiting or is it kept idle (therefore not reused) until the task completes ?

I would suspect the second one as it would be the behaviour for any thread that is not managed by the thread pool.

도움이 되었습니까?

해결책

Simple answer: No. The thread has no concept of a thread pool, so Wait can not do special things. Also reusing a thread like this may have serious side effects (on thread local variables which may have changed).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top