Skip to content

Add libdispatch based NSOperationQueue implementation#602

Open
HendrikHuebner wants to merge 8 commits intognustep:masterfrom
HendrikHuebner:dispatchQueues
Open

Add libdispatch based NSOperationQueue implementation#602
HendrikHuebner wants to merge 8 commits intognustep:masterfrom
HendrikHuebner:dispatchQueues

Conversation

@HendrikHuebner
Copy link
Copy Markdown
Contributor

This PR adds a new implementation for NSOperationQueue, which uses libdispatch instead of manually spawning threads.

The internal queue implementation is split into two classes: GSDispatchOperationQueue and GSThreadOperationQueue. If libdispatch is available, the dispatch implementation is chosen, otherwise we fall back to the old implementation. The logic for the thread implementation remains mostly unchanged, except for the structural change of moving most of the implementation to another class. I also fixed a bug here: If thread creation throws, we did not decrement the thread count afterwards.

Additionally, this PR adds the underlyingQueue property setter and getter, which is only enabled for libdispatch based implementations. See Apple docs for reference.

@HendrikHuebner HendrikHuebner requested a review from rfm as a code owner April 28, 2026 11:07
@HendrikHuebner
Copy link
Copy Markdown
Contributor Author

Hm I can't reproduce the build failure locally, will try again later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant