Wednesday, June 3, 2020
RStein.AsyncCpp (06-03-2020) - C++ Task Parallel Library



- Added AsyncMutex synchronization primitive.


- TaskFactory.Run automatically unwraps nested Task (e.g. scheduled lambda-coroutine returns Task). Very convenient and prevents some hard-to-debug, but easy to introduce bugs in C++ coroutines.


- Task has the Unwrap method ((Unwrap Task<Task<T> and returns Task<T>) and corresponding Fjoin method.


- Added SynchronizationContext - provides a mechanism to queue work to a specialized context. (useful for marshaling calls to UI thread, event loop, etc.)


- Added SynchronizationContextScope - RAII class for SynchronizationContext. An instance of this class captures the current synchronization context in the constructor (now 'old' context), installs new synchronization context provided by the user, and restores 'old' synchronization context in the destructor.)


- Added ConfigureAwait method (for the Task awaiter) - configures if the 'co_await continuation' is resumed in the specific synchronization context.


- Added GlobalTaskSettings::UseOnlyConfigureAwaitFalseBehavior configuration key - set the key to true if you want to enforce the equivalent of the 'co_await someTask.ConfigureAwait(false)' for all 'co_await someTask{anything}' expressions in the application - synchronization context is then never used when resuming the 'co_await continuation'.


- Task.ContinueWith method has new overloads with CancellationToken argument.

Wednesday, June 3, 2020 10:43:27 AM (Central Europe Standard Time, UTC+01:00)       
Comments [0]  C++ | Nativní kód