Provides types such as
ConcurrentHashSet<T>ConcurrentObservableCollection<T>SynchronizedList<T>AsyncAutoResetEventAsyncLockResettableCancellationTokenSourceKeyedLockKeyedAsyncLock
Provides extensions methods for
SemaphoreSlimTask
Simplifying task awaiting (blog post)
var (a, b) = await (task1, task2);
var (a, b) = await (task1, task2).ConfigureAwait(false);Thread-safe collection that can be bound to a UI control
using Meziantou.Framework.Collections.Concurrent;
// Created on the UI thread, so the notifications are raised on that thread
var collection = new ConcurrentObservableCollection<string>();
listBox.ItemsSource = collection.AsObservable;
// The collection itself is safe to use from any thread
await Task.Run(() => collection.Add("Item from a background thread"));The thread the notifications are raised on can also be set explicitly:
var collection = new ConcurrentObservableCollection<string>(synchronizationContext);