-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
Milestone
Description
Describe the bug
Each thread in Poco::ActiveThreadPool
has its own Poco::NotificationQueue
.
If I have 2 types of Runnable like this:
class LongTimeTask : public Poco::Runnable {
void run() {
sleep(2 * 60 * 1000);
}
};
class ShortTimeTask : public Poco::Runnable {
void run() {
sleep(1);
}
};
int capacity = 2;
Poco::ActiveThreadPool pool(capacity);
for (int i = 0; i < 10; i++) {
pool.start(new LongTimeTask); // [BUG!!!] all long time task will enqueue to thread#1
pool.start(new ShortTimeTask); // [BUG!!!] all short time task will enqueue to thread#2
}
thread#2 will always in idle, and thread#1 will always in busy !!!
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done