Espacio de nombres · Antril

System.Threading

Tipos

final class AtomicBool A bool that threads change together.
final class AtomicI32 An i32 that threads change together (each operation is atomic).
final class AtomicI64 An i64 that threads change together (as AtomicI32).
final class AutoResetEvent An event that lets one waiter through each time it is set (and resets itself).
final class BlockingCollection<T> A queue that hands items from producers to consumers: Take waits for an item; after CompleteAdding, Take on an empty queue throws and TryTake gives false.
final class ConcurrentQueue<T> A queue several threads use at once (a lock around a Queue).
final class Condition Waiting until another thread says something changed: Wait releases the mutex (which the caller holds) while it waits and takes it back before it returns.
final class CountdownEvent Set once it has been signaled initialCount times: Wait waits for that.
static class Interlocked Atomic operations on numbers in memory reached by pointers (unsafe code): Interlocked.Add(&counts[i], 1).
final class Lock A lock with the names Enter, Exit and TryEnter.
class ManualResetEvent An event that stays set until Reset: WaitOne returns at once while it is set.
class Mutex A lock: one thread at a time between Lock and Unlock (not re-entrant: a thread that holds it must not lock it again).
static class Parallel Loops whose passes run on several threads at once.
final class SemaphoreSlim Counts permits: Wait takes one (waiting while there are none), Release gives them back.
final class Shared<T> internal A value in an object (what several lambdas share and change).
final class Thread A thread of its own running a function: new Thread(() => …), Start, Join.
static class ThreadPool Threads that run queued work: as many as processors, started with the first work item, kept for the program.
Esc