Skip to content

Commit 8b0a42f

Browse files
committed
remove aggressive thread exits when oversubscribed; was causing significant churn
1 parent 571c8a0 commit 8b0a42f

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/queue.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5523,15 +5523,10 @@ _dispatch_worker_thread(void *context)
55235523

55245524
const int64_t timeout = 5ull * NSEC_PER_SEC;
55255525
pthread_priority_t old_pri = _dispatch_get_priority();
5526-
bool oversubscribed = false;
55275526
do {
55285527
_dispatch_root_queue_drain(dq, old_pri);
55295528
_dispatch_reset_priority_and_voucher(old_pri, NULL);
5530-
#if HAVE_INTERNAL_PTHREAD_WORKQUEUE
5531-
oversubscribed = os_atomic_load2o(qc, dgq_thread_pool_size, ordered) < 0;
5532-
#endif
5533-
} while (!oversubscribed &&
5534-
dispatch_semaphore_wait(&pqc->dpq_thread_mediator,
5529+
} while (dispatch_semaphore_wait(&pqc->dpq_thread_mediator,
55355530
dispatch_time(0, timeout)) == 0);
55365531

55375532
#if HAVE_INTERNAL_PTHREAD_WORKQUEUE

0 commit comments

Comments
 (0)