decline-cookies / anvil-unity-dots

Unity DOTS and ECS specific additions and extensions to Anvil
MIT License
4 stars 1 forks source link

IJobConfig - Add require exclusive write for EPD and CDFE + Cleanup #275

Closed mbaker3 closed 12 months ago

mbaker3 commented 12 months ago

What is the current behaviour?

Within an TaskDriver there is no way to:

As the use of Task Drivers has expanded well beyond the simple use cases originally imaged the the method naming for write access requirements has become ambiguous. Depending on the type, "Write" in a method name (Ex: RequireEntityPersistentDataForWrite could mean that the access handle is shared between all other concurrent write requests globally, all concurrent write requests associated with a Task Driver type's TaskDriverSystem, or something else. It's easy to forget or assume what type of access a you're getting as a developer. Shared vs Exclusive needs to be spell explicitly and new terminology needs to be devised to describe the unique write access provided to Unity ECS backed types (CDFE, DBFE, etc..)

What is the new behaviour?

IJobConfig: Rename require methods to better describe provided access

IJobConfig: Additional require types

IJobConfig + Implementations: Cleanup

Notes: The following methods were left as is for the reasons given below. I'm not against changing their names if you think it would be beneficial and have some naming ideas.

What issues does this resolve?

What PRs does this depend on?

Does this introduce a breaking change?

mbaker3 commented 12 months ago

Ready for re-review.

I think it's fine to leave the ThreadPersistentData as just "Write". Technically, it's a shared write if we want to be specific.

Same thing for the data stream, I'm fine with it being just "Write" but again if we wanted to be specific, it's a Shared Write.

Agreed, Shared write felt a bit weird since it's not something you need to be concerned about the way you are with other types. ...at least not if used correctly.