Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Module

System.Concurrency

module System.Concurrency

Workers and cancellation

Thread and ThreadPool run work through isolated runtime workers. CancellationToken, CancellationTokenSource and CancellationRegistration coordinate cooperative cancellation. Worker lifetime and cancellation are explicit; callbacks do not imply arbitrary shared-object access between workers.

Use Tasks for completion and composition. The API overview describes the current worker model; these APIs do not yet promise a green-thread scheduler.

Timer accepts synchronous callbacks or callbacks returning Task<()>. Use Start(Duration) for one run or Start(delay, interval) for repeating work. Repeating intervals begin after callback completion, including awaited work. Restart never overlaps an in-flight callback; Stop and Dispose suppress future runs without cancelling callback work. Cancelled callback tasks stop their schedule. Timers require invocation scheduler progress; they do not create threads.

CancellationTokenSource.CancelAfter(delay) schedules a cancellation request and replaces an earlier countdown. CancelAfter(Optional<Duration>.None()) disables it. Cancel and Dispose release the countdown. An already requested source cannot be reset; operations must still acknowledge cancellation and finish their cleanup.

Modules

1 item

Types

6 items
CancellationRegistration A disposable callback registration. Disposing removes a callback that has not started.
CancellationToken A copyable request-observation capability, independent of any task or scheduler.
CancellationTokenSource Owns cancellation authority. Requesting cancellation does not complete an operation.
Thread An explicit, isolated host thread with a retained completion task.
ThreadPool Provides the bounded isolated worker-pool API.
Timer An invocation-local timer. Callbacks run serially on the invocation's completion queue. Repeating timers wait their interval after each callback completes; missed ticks do not accu…