Skip to content

Commit

Permalink
Fixed: Unnecessary wake up signals when submitting jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
richardbiely committed Oct 28, 2024
1 parent 57b2ef7 commit d0c2a7a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
8 changes: 0 additions & 8 deletions include/gaia/mt/threadpool.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ namespace gaia {

const auto prio = (JobPriority)jobHandle.prio();
auto& jobQueue = m_jobQueue[(uint32_t)prio];
auto& cv = m_cv[(uint32_t)prio];

if GAIA_UNLIKELY (m_workers.empty()) {
(void)jobQueue.try_push(jobHandle);
Expand All @@ -218,9 +217,6 @@ namespace gaia {
// The thread is put to sleep if pushing the jobs fails.
while (!jobQueue.try_push(jobHandle))
poll(prio);

// Wake some worker thread
cv.notify_one();
}

private:
Expand All @@ -234,7 +230,6 @@ namespace gaia {

const auto prio = (JobPriority)jobHandle.prio();
auto& jobQueue = m_jobQueue[(uint32_t)prio];
auto& cv = m_cv[(uint32_t)prio];

if GAIA_UNLIKELY (m_workers.empty()) {
(void)jobQueue.try_push(jobHandle);
Expand All @@ -248,9 +243,6 @@ namespace gaia {
// The thread is put to sleep if pushing the jobs fails.
while (!jobQueue.try_push(jobHandle))
poll(prio);

// Wake some worker thread
cv.notify_one();
}

public:
Expand Down
8 changes: 0 additions & 8 deletions single_include/gaia.h
Original file line number Diff line number Diff line change
Expand Up @@ -14914,7 +14914,6 @@ namespace gaia {

const auto prio = (JobPriority)jobHandle.prio();
auto& jobQueue = m_jobQueue[(uint32_t)prio];
auto& cv = m_cv[(uint32_t)prio];

if GAIA_UNLIKELY (m_workers.empty()) {
(void)jobQueue.try_push(jobHandle);
Expand All @@ -14926,9 +14925,6 @@ namespace gaia {
// The thread is put to sleep if pushing the jobs fails.
while (!jobQueue.try_push(jobHandle))
poll(prio);

// Wake some worker thread
cv.notify_one();
}

private:
Expand All @@ -14942,7 +14938,6 @@ namespace gaia {

const auto prio = (JobPriority)jobHandle.prio();
auto& jobQueue = m_jobQueue[(uint32_t)prio];
auto& cv = m_cv[(uint32_t)prio];

if GAIA_UNLIKELY (m_workers.empty()) {
(void)jobQueue.try_push(jobHandle);
Expand All @@ -14956,9 +14951,6 @@ namespace gaia {
// The thread is put to sleep if pushing the jobs fails.
while (!jobQueue.try_push(jobHandle))
poll(prio);

// Wake some worker thread
cv.notify_one();
}

public:
Expand Down

0 comments on commit d0c2a7a

Please sign in to comment.