- Home /
Would using a static class inside a job system be safe in this context, where it is built-in to the execute struct?
The goal would be to not have to recreate an instance of OpenSimplexNoise every execute i. Oh, also I need a public before static yes? Thank-you!
Edit:
To clarify
Axiom 1: You can't access static methods within a Job, well you can but it's going to be removed from future versions cuz it's not thread safe.
Axiom 2: Every single instance of Execute() creates a whole new OpenSimplex object
Axiom 3: Instead of doing axiom 2, I would like to have one single static instance available to every Execute (the code with the //?)
Refined question: Does axiom 3 interfere with axiom 1, on account of the fact it is static. It is not externally static, so I have no idea is this is thread safe or not to do
I hope I clarified ok. Here is a link to the file https://drive.google.com/file/d/1FBL_gnJVZNXyTaSWE6Xmm16coticsaoW/view?usp=sharing
Your answer
![](https://koobas.hobune.stream/wayback/20220613011506im_/https://answers.unity.com/themes/thub/images/avi.jpg)