mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-02 16:49:03 +00:00
[PR #372] [MERGED] Moved main loop into FixedRate scheduler. Added sync lock on runnable. #4623
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/2006-Scape/2006Scape/pull/372
Author: @DamionDamion
Created: 2/9/2020
Status: ✅ Merged
Merged: 2/10/2020
Merged by: @dginovker
Base:
master← Head:fixedratetickloop📝 Commits (6)
3eb6e87Moved main loop into FixedRate scheduler. Added sync lock on runnable.fb1321cSynchronization lock not required for scheduleAtFixedRate(new Runnable(){}) https://stackoverflow.com/a/3549823000efcbbAdjust formattingb855a98Fix docob665504Added block on main thread until tick scheduler shutdown.1d95da8Move shutdown call outside for loop.📊 Changes
1 file changed (+66 additions, -36 deletions)
View changed files
📝
2006Redone Server/src/com/rebotted/GameEngine.java(+66 -36)📄 Description
Previous the main while{} loop featured a Thread.Sleep(600). This results in 600ms of unusable CPU time, or a maximum efficiency rate of 30%.
As each invocation is within a Runnable(), a synchronization lock is required to prevent concurrency.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.