Skip to content

Conversation

@xthexder
Copy link
Owner

@xthexder xthexder commented Apr 1, 2023

EntityLock<ECS, Permissions...> is a new lock type that is roughly equivalent to a std::pair<Lock<ECS, Permissions...>, Entity>.
This lock type can be used to perform parallel writes to multiple entities within a single transaction, while allowing reads to all entities.
Reads of values on entities not covered by the lock see the value as of the start of the transaction, with changes to other entities hidden until the transaction completes.

The Optional<> lock permission replaces DynamicLock<>, and allows for any existing Lock<ECS, Permissions...> to be declared as optional and checked at runtime.

Locks now properly reference count each component individually, allowing read-only lock permissions to be released early if a lock has been converted to a subset, and no more references to that component exist.
ECS component storage also has a new WriteToReadLock call, which allows a Write permission to be downgraded to Read permissions without starting a new transaction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants