IsCancellationRequested
**IsCancellationToken** is a class in the .NET framework that represents a flag used to coordinate cancellation across thread boundaries in asynchronous operations. Introduced in .NET 4.5, it plays a key role in implementing cooperative cancellation, allowing threads to respond gracefully to cancellation requests without abrupt termination.
The class is part of the `System.Threading` namespace and is typically used alongside `CancellationTokenSource`, which generates
- **Thread-safe operation**: Tokens can be safely shared across threads.
- **Cooperative cancellation**: Only methods explicitly checking the token will respond to cancellation.
- **Combining tokens**: Multiple tokens can be combined using `CancellationTokenSource.CreateLinkedTokenSource` to monitor multiple cancellation requests.
Common use cases include long-running operations (e.g., file downloads, database queries) where cancellation is desirable for
While cancellation is cooperative, it does not prevent thread termination—only the cancellation-aware code will halt. Unmanaged