Skip to content
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

[Freestanding] Disable unstructured tasks. #59726

Merged

Commits on Jul 6, 2022

  1. [Freestanding] Use task-to-thread concurrency model.

    Defined SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY to describe
    whether the standard library will use the task-to-thread model for
    concurrency.  It is true only for freestanding non-Darwin stdlibs.
    
    When it is true, SWIFT_CONCURRENCY_TASK_TO_THREAD_MODEL is defined
    during stdlib compilation of both Swift and C++ sources.
    
    Added an option to LangOptions to specify which concurrency model is
    used, either standard or task-to-thread.  When
    SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY is true, the model is
    specified to be task-to-thread.
    nate-chandler committed Jul 6, 2022
    Configuration menu
    Copy the full SHA
    b03904d View commit details
    Browse the repository at this point in the history
  2. [TaskToThread] No unstructured tasks.

    In this mode, the following are disabled:
    
    - task creation
    - global actors
    - MainActor
    - custom executors
    nate-chandler committed Jul 6, 2022
    Configuration menu
    Copy the full SHA
    68eea8a View commit details
    Browse the repository at this point in the history
  3. [NFC] Removed unused argument.

    Previously getAsyncClosureEntryPointAndContextSize took both a pointer
    for a function and a closure context.  That was a relic of a temporary
    ABI where async function pointers were not used in all cases.  Now that
    that ABI is long gone, async function pointers are always used.
    Consequently, the closure context argument was unused.  Here, the
    closure context argument is removed.
    nate-chandler committed Jul 6, 2022
    Configuration menu
    Copy the full SHA
    da45a67 View commit details
    Browse the repository at this point in the history
  4. [NFC] Extracted function for header/context size.

    So that this functionality is available elsewhere, extract it from
    swift_task_create_commonImpl into a reusable static functions.
    nate-chandler committed Jul 6, 2022
    Configuration menu
    Copy the full SHA
    59f6cbc View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    84f5eb5 View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2022

  1. [TaskToThread] Add Task.runInline.

    The new intrinsic, exposed via static functions on Task<T, Never> and
    Task<T, Error> (rethrowing), begins an asynchronous context within a
    synchronous caller's context.  This is only available for use under the
    task-to-thread concurrency model, and even then only under SPI.
    nate-chandler committed Jul 8, 2022
    Configuration menu
    Copy the full SHA
    34c08b8 View commit details
    Browse the repository at this point in the history