Menu

#7 Deadlock in Pool_executor_factory

v0.8.x
open
nobody
Stability (5)
5
2013-02-08
2010-10-26
Jaroslaw
No

Suppose Pool_executor_factory was created and some Pool_executor_factory::Pool_thread are created also.
Suppose that at the same moment:
1. One of threads is executing "executor->process_actual_execution()" while in Pool_executor_factory::Pool_thread::operator ()()
2. Pool_executor_factory::~Pool_executor_factory is called

What happens then:
1. Desctuctor of Pool_executor_factory calls "req_queue_cond.n()" and waits for all threads to join.
2. The thead which was executing "executor->process_actual_execution()" ends its work and waits on condition "pool->req_queue_cond.wait(lk);"
3. But notify_all or notify_one won't be called. It is a deadlock.

Discussion


Log in to post a comment.