I think Udon2 is almost impossible to implement multithreading with the current known exposure design, and there may be serious security or stability issues with such a design.
Unless side-effects and state can be completely removed, it would be almost impossible to solve the problem just by considering the copying and releasing of memory content, which is similar to cross-programming language ‘ABI’, or it would require a serious performance cost to implement, which is not worth it.
I personally think that we should solve the basic performance problems first, and then when there is really no way to improve it and there is a need to start solving it, the official percentage of improvement and my own evaluation will be about 10 to 100 times slower than the original C# native performance that allows compilation, and there is still a lot of room for improvement.
This idea is similar to C++ with lua. Whether lua causes C++ to become multi-threaded, or lua itself is multi-threaded, it’s crazy.
Only if the C++ function called by lua itself is multi-threaded, it is normal to make it work a lot.
For example, the Unity animation controller itself is designed to be multi-threaded on the execution side, so that it can share the workload.
Rather than implementing logic in the animation controller’s state machine at runtime to make it multithreaded, or in the animation controller’s editing tools or state machine, the design of the animation controller is such that the actual work driven by the state machine is multithreaded.
It should be designed so that the logic behind the animation controller to update the driver bones, etc. is multi-threaded.
(Of course, in fact, most animation controllers do not interfere with each other, so of course they can be parallelized, except for changes that may affect each other, such as bone and object states, which are time-consuming enough to gradually become single-threaded.)