Multithreading in PaperMC

Performance is a serious issue for servers, and since the release of 1.13 the issues preventing servers from upgrading only seem to rise. Adding multithreading support will allow for Minecraft Servers to be able to upgrade to 1.14 and 1.15, which are known to have issues with chunk loading and lighting.

The inability to use more than one thread is a huge restriction for servers. There are certain processes that can and should be done in parallel.

Some things that should be added include

  1. multithreaded chunk loading
  2. multithreaded chunk generation
  3. per-dimension tick threads, with synchronization on going through a portal
  4. chunk serialization and gzipping for saving to disk to be done in a separate thread
  5. an option to make lighting not calculated server side
  6. all mobs AI should be ticked simultaneously, this includes mob pathing to players and other things
  7. move as much packet handling as possible to the netty thread