You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have added a heap allocated Poco::Event with autoreset = true as a member variable in the threadpool. When the threadpool spawns a pooled thread, it passes a reference to this event. Then, at the end of PooledThread.run() right after _targetCompleted.set() I also signal this ThreadPool owned event. This way, when a job queue that owns a threadpool checks ThreadPool->available() and finds no threads are available it can then execute ThreadPool->thisEvent.wait() and will be notified when a thread becomes available so that it can launch a new job on the pool. In this way, a job queue manager doesn't have to continuously probe threadpool->available().
What do you think? Is this feature worth integrating?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have added a heap allocated Poco::Event with autoreset = true as a member variable in the threadpool. When the threadpool spawns a pooled thread, it passes a reference to this event. Then, at the end of PooledThread.run() right after _targetCompleted.set() I also signal this ThreadPool owned event. This way, when a job queue that owns a threadpool checks ThreadPool->available() and finds no threads are available it can then execute ThreadPool->thisEvent.wait() and will be notified when a thread becomes available so that it can launch a new job on the pool. In this way, a job queue manager doesn't have to continuously probe threadpool->available().
What do you think? Is this feature worth integrating?
Beta Was this translation helpful? Give feedback.
All reactions