Skip to content

[Async CC] Propagate runtime values. #34454

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

Conversation

nate-chandler
Copy link
Contributor

@nate-chandler nate-chandler commented Oct 27, 2020

Based on #34453 .

This PR covers makes a few somewhat related changes:

  • add field to async layout for Parent
  • add field to async layout for ResumeParent
  • add field to async layout for ResumeParentExecutor
  • store caller async contexts into child async contexts
  • store caller executors into child async contexts
  • pass caller task to swift_task_alloc/swift_task_dealloc
  • pass caller task to callee
  • pass caller executor to callee

@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler nate-chandler changed the title [Async CC] Thread values into storage and calls. [Async CC] Store and pass runtime values. Oct 27, 2020
@nate-chandler nate-chandler force-pushed the concurrency/irgen/threading-values-through branch from adfd2d1 to 6e2da18 Compare October 27, 2020 16:54
@nate-chandler nate-chandler force-pushed the concurrency/irgen/threading-values-through branch 4 times, most recently from 38e0e33 to 6d08df2 Compare October 27, 2020 19:37
Previously, a null task was always passed to
swift_task_alloc/swift_task_dealloc.  Now that the current task is
available as one of the arguments to every async function, pass that
value along to the runtime de/allocation functions.
When an async function is called from an async function, it stores its
own context pointer into the callee's callerContext.
@nate-chandler nate-chandler force-pushed the concurrency/irgen/threading-values-through branch from 6d08df2 to f3923e0 Compare October 27, 2020 19:41
@nate-chandler nate-chandler marked this pull request as ready for review October 27, 2020 19:41
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

When an async function is called from an async function, the caller
stores its own executor into the the callee's context in the
ResumeParentExecutor field.
@nate-chandler nate-chandler force-pushed the concurrency/irgen/threading-values-through branch from f3923e0 to 2ff6ea3 Compare October 27, 2020 20:53
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler nate-chandler changed the title [Async CC] Store and pass runtime values. [Async CC] Propagate runtime values. Oct 27, 2020
@nate-chandler nate-chandler merged commit 2bcc74c into swiftlang:main Oct 28, 2020
@nate-chandler nate-chandler deleted the concurrency/irgen/threading-values-through branch October 28, 2020 00:55
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.

1 participant