edict
edict copied to clipboard
Parallel queries from threads
Could you please briefly describe how the parallel queries will work?
Atomic borrows from &World
(kinda like in hecs) will validate that mutable aliases are never created by queries.
Unsafe unchecked version of methods would exist for those who need them.
Stageless scheduler will run systems without conflicts as systems specify ahead of time what components they access and how. Scheduler will probably live in another crate.
Here is plan to make parallel access possible:
- [ ] Make World::epoch atomic;
- [ ] Implement
query_mut_unchecked
,query_one_mut_unchecked
,for_each_mut_unchecked
,for_each_tracked_mut_unchecked
,get_mut_unchecked
unsafe methods forWorld
; - [ ] Maybe add a runtime check for aliasing like
hecs
does byFetch::borrow
andFetch::release
.
Threading support is implemented using runtime checks. Unsafe version could be added IF profiling would show that checks is a bottleneck