Navigation
API > API/Runtime > API/Runtime/Chaos > API/Runtime/Chaos/Framework
References
| Module | Chaos |
| Header | /Engine/Source/Runtime/Experimental/Chaos/Public/Framework/Threading.h |
| Include | #include "Framework/Threading.h" |
Syntax
template<typename MutexType>
class TRwFifoLock
Remarks
A first-in, first-out "fair" read-write lock around a generic mutex Given a mutex (either just FCriticalSection or some custom lock) this class implements a fair lock. Any number of readers can enter the lock but as soon as a writer attempts to enter the lock all subsequent readers are forced to wait until the current readers leave the lock and the writer gets a chance to perform its operation. Once the write is completed the waiting readers are able to resume. This ensures we do not end up in a situation where we have a write waiting but many reads end up constantly forcing the write to wait. In a physics context a write on the game thread is time-critical and we want that thread to resume as soon as possible by pausing any reads (scene queries) until the write is finished
Constructors
| Type | Name | Description | |
|---|---|---|---|
TRwFifoLock () |
Destructors
| Type | Name | Description | |
|---|---|---|---|
~TRwFifoLock () |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | ReadLock () |
||
| void | ReadUnlock () |
||
| void | WriteLock () |
||
| void | WriteUnlock () |