Skip to content

Commit 6d2414c

Browse files
authored
Merge pull request #39732 from ktoso/wip-limit-width-linux
[Concurrency] Limit queue width with set_width SPI call on linux
2 parents 9ffd99d + 8578d22 commit 6d2414c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/Concurrency/GlobalExecutor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ static constexpr size_t globalQueueCacheCount =
275275
static_cast<size_t>(JobPriority::UserInteractive) + 1;
276276
static std::atomic<dispatch_queue_t> globalQueueCache[globalQueueCacheCount];
277277

278-
#ifdef SWIFT_CONCURRENCY_BACK_DEPLOYMENT
278+
#if defined(SWIFT_CONCURRENCY_BACK_DEPLOYMENT) || defined(__linux__)
279279
extern "C" void dispatch_queue_set_width(dispatch_queue_t dq, long width);
280280
#endif
281281

@@ -295,7 +295,7 @@ static dispatch_queue_t getGlobalQueue(JobPriority priority) {
295295
if (SWIFT_LIKELY(queue))
296296
return queue;
297297

298-
#ifdef SWIFT_CONCURRENCY_BACK_DEPLOYMENT
298+
#if defined(SWIFT_CONCURRENCY_BACK_DEPLOYMENT) || defined(__linux__)
299299
const int DISPATCH_QUEUE_WIDTH_MAX_LOGICAL_CPUS = -3;
300300

301301
// Create a new cooperative concurrent queue and swap it in.

0 commit comments

Comments
 (0)