Will the capability to use static data inside managed jobs eventually be removed? The documentation says that this will be removed in future unity versions https://docs.unity.cn/2022.1/Documentation/Manual/JobSystemTroubleshooting.html#:~:text=Because of this risk%2C future versions of Unity will prevent global variable access from jobs using static analysis
#Static data inside managed jobs?
1 messages · Page 1 of 1 (latest)
I don't have a good timeline for when this would be removed, however if you Burst compile your jobs, you are not allowed to refer to static data so you do have a shortcut to disallowing statics usage in jobs.
You are allowed static readonly data though right? Because burst handles that by copying it
Correct. static readonly is ok as that data is ensured to be immutable.
Technically you can even get mutable static data in a burst job using Burst SharedStatics as those allow for a static readonly indirection to native memory (so the ptr is immutable but not the data). However I would not recommend that for general use, but a good tool to have in case you have a particular use case