TFairSemaphoreSection Class

Source: Math387.cs · Assembly: Dew.Math

public class TFairSemaphoreSection

Critical section with semaphore capability.

This class allows multiple threads to run concurrently within a critical section. The maximum number of such threads will be limited to "Count".

The threads will enter strictly in the order in which they arrive, but they may exit in any order depending on the workload assigned to each thread within the critical section.

If all threads require a shared resource, this construct allows the programmer to limit the number of threads to the number of available shared resource(s).

Properties

NameTypeDescription
CountInt32Specifies the number of threads that can enter concurrently.

Methods

NameDescription
ctorInitialize the critical section.
EnterEnter the critical section.
Leave (2)Leave the critical section.