Go to file
Aikar 7dfbe44247
Improved Async Task Scheduler
The Craft Scheduler still uses the primary thread for task scheduling.
This results in the main thread still having to do work as part of the
dispatching of async tasks.

If plugins make use of lots of async tasks, such as particle emitters
that want to keep the logic off the main thread, the main thread still
receives quite a bit of load from processing all of these queued tasks.

Additionally, resizing and managing the pending entries for all of
these asynchronous tasks takes up time on the main thread too.

This commit replaces the implementation of the scheduler when working
with asynchronous tasks, by forwarding calls to the new scheduler.

The Async Scheduler uses a single thread executor for "management" tasks.
The Management Thread is responsible for all adding and dispatching of
scheduled tasks.

The mainThreadHeartbeat will send a heartbeat task to the management thread
with the currentTick value, so that it can find which tasks to execute.

Scheduling of an async tasks also dispatches a management task, ensuring
that any Queue resizing operation occurs off of the main thread.

The async queue uses a complete separate PriorityQueue, ensuring that resize
operations are decoupled from the sync tasks queue.

Additionally, an optimization was made that if a plugin schedules
a single, non repeating, no delay task, that we immediately dispatch it
to the executor pool instead of scheduling it. This avoids an unnecessary
round trip through the queue, as well as will reduce the size growth of the
queue if a plugin schedules lots of asynchronous tasks.
2018-03-16 23:09:51 -04:00
.github
licenses [CI-SKIP] Clarify project licensing 2018-03-06 20:41:03 -05:00
scripts Use a more general method of aliasing md5sum 2018-02-23 18:58:45 -06:00
Spigot-API-Patches Add OBFHELPER - InventoryEnderChest#getTileEntity 2018-03-10 17:11:51 +00:00
Spigot-Server-Patches Improved Async Task Scheduler 2018-03-16 23:09:51 -04:00
work Update CB/S 2018-03-08 19:36:35 +00:00
.gitignore [CI-SKIP] macOS filesystem dust made it past gitignore! 2018-03-13 18:43:13 -04:00
.gitmodules
.travis.yml
CONTRIBUTING.md Add file import and patch notes to CONTRIBUTING.md 2018-01-24 22:47:00 -05:00
LICENSE.md [CI-SKIP] Add vemacs to MIT list (#1043) 2018-03-11 12:16:52 -07:00
paper Add clean command and fix critical script issue 2017-09-28 17:52:05 -05:00
pom.xml update url to my repo 2018-02-19 22:35:32 -05:00
README.md Update README badge for CI URL change 2018-01-06 02:44:48 -06:00

Paper Build Status

High performance Spigot fork that aims to fix gameplay and mechanics inconsistencies.

IRC Support and Project Discussion

Documentation

Access the Paper docs here: paper.readthedocs.io
Access the Paper API javadocs here: paperdocs.emc.gs

How To (Server Admins)

Paperclip is a jar file that you can download and run just like a normal jar file.

Download a copy of paperclip.jar from our build server, here.

Run the Paperclip jar directly from your server. Just like old times

Paper requires Java 8 or above.

How To (Compiling Jar From Source)

To compile Paper, you need JDK 8, maven, and an internet connection.

Clone this repo, run ./paper jar from bash, get files.

How To (Pull Request)

See Contributing

Special Thanks To:

YourKit-Logo

YourKit, makers of the outstanding java profiler, support open source projects of all kinds with their full featured Java and .NET application profilers. We thank them for granting Paper an OSS license so that we can make our software the best it can be.