Glowstone has 4 groups of threads:
- World threads. One thread per world
- Event/scheduler thread. This thread contains all interaction with Bukkit API and synchronizes all other threads.
- Async task thread pool. Pool of threads used to execute async tasks
- Netty thread pool. This thread pool is used by Netty for network read/write
Whenever a thread wishes to call an event or perform other interactions with Bukkit API, it
The scheduler thread synchronizes the world threads, so that each world thread begins a tick at the beginning of a scheduler pulse.
- Scheduler tick begins
- Pulse sessions
- run sync tasks, queue async tasks
- World tick for each world
- Run in-tick tasks
- await all worlds complete (in async task)