Do I have to rewrite Mathf.PerlinNoise to multi-thread it?

So i’m trying to make a procedural generated map and it kinda working quite ok

then i notice every time it generate a new chunk the game hickup so i try to make generating map data using Threading

but i remember that Unity doesn’t want other Thread to touch the main Thread so i came up with an idea: “Re-write entire Perlin Noise func so it could work with the Threading without touching UnityEngine Mathf.PerlinNoise”

And i found Perlin.cs on Unity repo and actually download and modify it.

SO the legal question is:

Can i use this version of Perlin.cs instead of Mathf.PerlinNoise Unity provided bc they’re basically are the same from one script?

but i remember that Unity doesn’t want other Thread to touch the main Thread

This description is not accurate. Thread safety is a issue of data access. Functional code ( Mathf.PerlinNoise included) has no state data so it is thread safe (any thread can access it).