summaryrefslogtreecommitdiffstats
path: root/pom.xml
diff options
context:
space:
mode:
authorWesley Wolfe <weswolf@aol.com>2012-08-14 06:09:51 -0500
committerfeildmaster <admin@feildmaster.com>2012-08-22 16:41:46 -0500
commitdcd01bf0c0b87d1aaa1ec46bf58bd2750d0a9904 (patch)
tree2de4c1d90ae972dbb326e0b6e04308b505eaaf5f /pom.xml
parent8fdb006143f34a5bbfaadf4d1677ac7fb40403fb (diff)
downloadcraftbukkit-dcd01bf0c0b87d1aaa1ec46bf58bd2750d0a9904.tar
craftbukkit-dcd01bf0c0b87d1aaa1ec46bf58bd2750d0a9904.tar.gz
craftbukkit-dcd01bf0c0b87d1aaa1ec46bf58bd2750d0a9904.tar.lz
craftbukkit-dcd01bf0c0b87d1aaa1ec46bf58bd2750d0a9904.tar.xz
craftbukkit-dcd01bf0c0b87d1aaa1ec46bf58bd2750d0a9904.zip
Rewrite scheduler. Fixes BUKKIT-1831, and BUKKIT-845
The new scheduler uses a non-blocking methodology. Combining volatile references to make a linked reference chain, with the atomic reference handling the tail, tasks are queued without waiting for locks. The main thread will no longer limit the length of time spend for scheduled tasks, but no task will run twice in the same tick. Scheduling a new task inside of a synchronous task will always run the new task during the same tick, assuming there is no supplied delay > 0. Asynchronous tasks are now run using a thread pool. Any thread-local implemenation should now account for threads being reused between executions. Race conditions were carefully examined and the order of logic is now very important. Each task is placed in a secondary collection before removal from primary collections. Thus, by reading tasks from the collections in the same order they travel, it retains state-safety. This does make modifications less responsive in some situations, as the task may be transitioning before the modifier accesses it. This cost outweighs the requirement to synchronize on the scheduler; previously any conflict would be first-come-first-serve, with the main thread backing out arbitrarily.
Diffstat (limited to 'pom.xml')
0 files changed, 0 insertions, 0 deletions