Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Ross Allan <rallanpcl@gmail.com>
  • Loading branch information
LunNova committed Jul 25, 2013
1 parent e5fefac commit f0e6d60
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
25 changes: 25 additions & 0 deletions IMPLEMENTATION.md
@@ -0,0 +1,25 @@
Patching
====

TT's patcher is quite simple, and based on javassist. It is configured via the patches(-deobfuscated).xml in the resources directory. The choice of XML for expressing patches is suboptimal, and other options will be available at some point.

The actual implementation of the patches used in the patch xml is in the `nallar.tickthreading.patcher.Patches` class.

For coremods and the minecraft server jar, the jar is modified. Mods folder mods are not modified directly, instead patched classes are stored in the patchedMods directory, and loaded at runtime. This allows TT to bypass any signature verification checks.

Concurrency model
====

In vanilla, a single thread ticks everything in order. The worlds, entites in the worlds, processes packets, and then repeats. This must be done in less than 50ms.

For compatibility reasons, TT still sticks with this model - one world can not run ticks ahead of another.

Each tick, first the post server tick is handled by all mods with tick handlers. This is not performed concurrently.

Then, all worlds are ticked. Each world is ticked in a separate thread, up to a maximum of the number of threads set in the config. Entity and tile entity ticks are also concurrent within a world.

Each world is split up into regions of the size set in the config, and a list of these regions is made. The number of threads set in the config are used to tick these regions.

The world tick waits on completion of this until moving on to do other tasks. Waiting for completion can be disabled, but increases the risk of bugs, as then chunk unloading can occur while tile/entities are being ticked.

The server thread waits for all world ticks to complete, then processes all received packets. This then repeats from the start.
4 changes: 2 additions & 2 deletions README.md
@@ -1,9 +1,9 @@
TickThreading [![Build Status](http://nallar.me/buildservice/job/TickThreading/badge/icon)](http://nallar.me/buildservice/job/TickThreading/)
==========
Mod to run entity and tileentity ticks in threads and a patcher to make the server and any mods/plugins threadsafe.
Optionally, allows for automatically variable tick rate per tick region. (Normally a chunk)
Multi-threaded minecraft server implementation. Compatible with Forge and MCPC+.

Copyright &copy; 2012, nallar <rallan.pcl+tt@gmail.com>

TickThreading is licensed under the [N Open License, Version 1][License]

Download
Expand Down

0 comments on commit f0e6d60

Please sign in to comment.