This is an project based on the Unity Asteroids sample show-casing a surprisingly functional example of running the Server World update on another thread which isn't the main thread. InitializationSystemGroup is still on main thread.
- Open the Netcode samples Netcode samples project
- Disable JobsDebugger
- Open and run the Asteroids scene
- The ServerWorld update is run on a non-main thread as can be seen in the profiler
This is just a very quick and dirty implementation. Some obvious problems:
- JobsDebugger doesn't work.
- Might have some weird race condition with scheduling jobs on both main thread and server update thread.
- Allocator.Temp doesn't work on server update thread (changed a lot of these to TempJob).
- Didn't care about fixing leaks after Temp -> TempJob change so there is a lot of TempJob leaks.