Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add safety to CDFE and DBFE Writers #197

Open
mbaker3 opened this issue Apr 11, 2023 · 0 comments
Open

Add safety to CDFE and DBFE Writers #197

mbaker3 opened this issue Apr 11, 2023 · 0 comments
Labels
effort-high Focused - 4 to 8 hours priority-medium Standard task, plan as you see fit. status-backlog Tasks captured but not yet planned. type-feature New feature or request

Comments

@mbaker3
Copy link
Member

mbaker3 commented Apr 11, 2023

Both the CDFEWriter and DBFEForExclusiveWriterequire have theNativeDisableContainerSafetyRestriction` attribute applied to their lookups. Apply the safety system to the writer/reader level and allow them to co-exist if part of they are part of the same root level job. If the same instance of the writer is being used in a readonly context it should be allowed.

From the remarks on the type:

/// <remarks>
/// NOTE: The <see cref="ComponentDataFromEntity{T}"/> has the
/// <see cref="NativeDisableContainerSafetyRestrictionAttribute"/> applied meaning that Unity will not issue
/// safety warnings when using it in jobs. This is because there might be many jobs of the same type but
/// representing different <see cref="AbstractTaskDriver"/>s and Unity's safety system gets upset if you straddle
/// across the jobs.
/// </remarks>

This is also required to support the JobPart pattern where parts of jobs are written then then composed into a parent job. If some parts require read access and others write then the safety system throws errors.

@mbaker3 mbaker3 added effort-high Focused - 4 to 8 hours priority-medium Standard task, plan as you see fit. status-backlog Tasks captured but not yet planned. type-feature New feature or request labels Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort-high Focused - 4 to 8 hours priority-medium Standard task, plan as you see fit. status-backlog Tasks captured but not yet planned. type-feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant