EcoCityCraft/Spigot — pull request #4 by dreadslicer (2012-09-24 20:03:16+00:00)
Title: Multithreading branch (+Chunk unloaders and performance updates)

I have been working on a modification to Spigot that adds Multithreading!

This branch is currently running for MCPC (tekkit), however, Porting to other versions is easily possible.

Dependencies:
* craftbukkit-1.2.5-R4.1-MCPC-SNAPSHOT.jar

How does it work?
* I split the entire server thread down into a (5+worlds*4) permutation for the number of tasks that are possible.
* These tasks are threadpooled and ran at a seamless rate. This rate, or "MaxTPS" as stated in the performance.ini will set just how fast the server may go. Each task is "Run" every [1000/(ticks*(5+worlds*4))] milliseconds.
* I had to place another thread entirely dedicated to events. this thread runs every 10 milliseconds to keep up with demand.

**Does it work?**
* I have tested this on a single core computer and a multi-core computer. Obviously, the multi-core computer wins hands-down. However, the single-core would work best without multi-threading.
* at the moment, this works with Tekkit Mods through the MCPC folder. I will branch through main as soon as I get a copy of the latest 3.1.2.
* **Performance on single-core** - This branch is not designed for single-cores. however, you MUST lower your tick rates. (Dynamic TPS setting will come soon)
* **Performance on multiple-core** - 20 TPS all around, 2000 chunks maximum loaded. Running about 40 plugins, such as population density, worldedit, ect.

Features added:
* This modification currently adds chunk unloading for every tick so servers do not get above X amount of chunks within a Y radius from the player. (3000, 256 as default)