Skip to content

Allow building a concurrent libSwiftConcurrency without libdispatch #39480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 28, 2021

Conversation

rjmccall
Copy link
Contributor

The goal here is not to eventually implement a concurrent thread pool ourselves. We're just making it easier for integrators who have their own pool and don't want to use Dispatch to build the Swift concurrency runtime. Just hook the right functions and you should be fine.

The necessary functions to hook are:

  • swift_task_enqueueGlobal
  • swift_task_enqueueGlobalAfterDelay

The following functions would be necessary to hook:

  • swift_task_enqueueMainExecutor
  • swift_task_asyncMainDrainQueue (only if you have an async main?)
    However, this configuration does not currently properly support the main executor, and so @MainActor should be avoided for now.

rdar://83513751

The goal here is not to eventually implement a concurrent thread
pool ourselves.  We're just making it easier for integrators who
have their own pool and don't want to use Dispatch to build the
Swift concurrency runtime.  Just hook the right functions and
you should be fine.

The necessary functions to hook are:
- swift_task_enqueueGlobal
- swift_task_enqueueGlobalAfterDelay

The following functions *would* be necessary to hook:
- swift_task_enqueueMainExecutor
- swift_task_asyncMainDrainQueue (only if you have an async main?)
However, this configuration does not currently properly support
the main executor, and so `@MainActor` should be avoided for now.

rdar://83513751
@rjmccall
Copy link
Contributor Author

@swift-ci Please test and merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants