mojira.dev
MC-280246

Possible problem with the minecraft server tick loop

Summary:
Problem with Minecraft's tickloop system, thread sleeping possibly for the wrong time

Steps to Reproduce:
Unless you have access to the Minecraft repository, you will have to use some decompiler, in my case I used a "Minecraft Server fork" called Paper and I saw that it didn't change at that time so this was a vanilla problem.

Steps:

In the new version/Paper, Go to class "BlockableEventLoop" (Paper class name, not sure if it is the same in vanilla)
Find the waitForRuns() method
In the old version (1.13), you can use MCP-Reborn to check in the MinecraftServer.java class

Observed Results:
Previously in Minecraft 1.13 in the tickloop system, Mojang used Thread.sleep(1L), 1L = 1 millisecond, from Minecraft 1.14 it started using java.util.concurrent.locks.LockSupport.parkNanos(), with the value of 100000L which is equivalent to 0.1 millisecond, which seems to me to be a calculation error, unless I made a mistake in the calculations or mojang did it on purpose.

Expected Results:
The value passed should be 1000000 which is equivalent to 1 millisecond as before.

Comments 1

If this has any measurable impact on the game, please post a bug referencing that impact. Otherwise, this is invalid.

[MOD] Greymagic27

(Unassigned)

Plausible

(Unassigned)

1.21.4

Retrieved