The Threading Pattern Library helps building multi-threaded applications with fewer lines of code and fewer defects. The library implements locking models (thread unsafe, reader-writer synchronized, actor), thread synchronization aspects (to background thread, to UI thread), and a deadlock detection facility.
It provides the following features:
Threading Models. A threading model is a design pattern that gives guarantees that your code executes safely on a multi-threaded computer. Three models are implemented: Thread Exclusive (thread unsafe), Reader-Writer Synchronized, and Actor. See Writing Thread-Safe Code with Threading Models for details.
Thread Dispatching. Custom attributes DispatchedAttribute and BackgroundAttribute cause the execution of a method to be dispatched to the UI thread or to a background thread, respectively. For details, read Dispatching a Method to the UI Thread and Dispatching a Method to Background.
Deadlock Detection. Detects deadlocks at runtime and throws an exception instead of allowing your application to freeze. For details, see Detecting Deadlocks at Runtime.