Conversation
Collaborator
Author
|
Semantic owner link (swift-institute/.github#591): this open PR implements swift-foundations/swift-kernel#16. Exact PR head at adjudication: 046fa86. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Kernel.Thread.runfor borrowedSendable & ~Copyable & ~Escapableinputsendingthrough the existing consuming-transferspawnoverload, removing the public@Sendableoperation requirementsendingmove-only output with exact typed creation, join, and operation failureswithoutActuallyEscapingbridge to the deepestKernel.ThreadimplementationStructured safety law
The input borrow remains scoped until physical join on every path. The operation and its disconnected capture region move into the worker context and are consumed exactly once. The actual escaping OS-thread entry body is captureless and therefore
@Sendable.Input: Sendableremains necessary because a borrow does not disconnect unrelated aliases; physical join bounds lifetime but cannot prevent concurrent access through those aliases. The result endpoint moves with the context and output returns assending.Control boundary
No generic thread-cancellation API is added. A higher owner may capture a caller-retained, synchronized, operation-specific endpoint in both the operation and a task cancellation handler. That is genuine concurrent sharing: Swift cancellation handlers are unavoidably
@Sendable, and the endpoint must itself own precise wake semantics. No portable thread primitive can interrupt an arbitrary blocking syscall safely.Stack
This draft is stacked on #15 at exact base
f12f7def2eb02bd910d7e5e8d72160216f92b078; it does not broaden that pull request.Verification
UNVERIFIED under the active source/static-only moratorium. No build, test, resolve, update, clean, run, compose, typecheck, lint, compiler probe, CI read, or
Package.resolvedmutation was performed.