System.SyncObjs.TLightweightEvent
Delphi
TLightweightEvent = class(TSynchroObject)
C++
class PASCALIMPLEMENTATION TLightweightEvent : public TSynchroObject
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
class | public | System.SyncObjs.pas System.SyncObjs.hpp |
System.SyncObjs | System.SyncObjs |
Description
Represents a lightweight mechanism for inter-thread signaling.
Threads can use TLightweightEvent to synchronize their activity. The execution of threads is usually not perfectly independent. A thread may have to wait until another thread reaches a specific point of execution.
TLightweightEvent implements a manual reset event using only atomic operations.
TLightweightEvent can have the following states:
Non-signaled | Threads cannot run independently. A thread that calls WaitFor spends a number of cycles in spin loops and can be blocked at kernel level. |
Signaled | Threads can run independently. |
TLightweightEvent should be used in cases where the non-signaled intervals are relatively short. If TLightweightEvent is used in cases where most of the calls to WaitFor block the calling thread, then the performance may be slightly below that of TSimpleEvent.