Hytale Server uses a combination of standard Java concurrency tools and Netty’s event loops.
| Thread Name | Description |
|---|---|
| Main | The initial thread that handles boot, setup, and plugin initialization. |
| Scheduler | A Single Thread Scheduled Executor (HytaleServer.SCHEDULED_EXECUTOR) used for periodic tasks like config saving and backups. |
| KeepAlive | A daemon thread that keeps the JVM alive if other threads exit. |
| ShutdownThread | Handles the graceful shutdown sequence. |
The server configures the common ForkJoinPool to use HytaleForkJoinThreadFactory. This pool is likely used for parallel processing of tasks, such as chunk generation or heavy computation.
Network I/O is handled by Netty.
The code relies heavily on CompletableFuture for asynchronous operations, particularly in:
Universe.loadWorld returns a CompletableFuture.PluginBase.preLoad() returns a CompletableFuture.ReentrantReadWriteLock used when modifying asset registries.ReentrantReadWriteLock protecting the plugin state and list.