15 Commits

Author SHA1 Message Date
Spottedleaf
7071e24ea7 Update ScheduledTaskThreadPool
1. Make halt() unpark waiting threads
   Fixes https://github.com/PaperMC/Folia/issues/338
2. Make intermediate task parsing steal tasks less aggressively
2025-04-03 15:37:31 -07:00
Spottedleaf
8822da77b7 Update ScheduledTaskThreadPool
1. Adjust insertion last task process time to be the current time.
   This makes fresh inserts to be scheduled fairly with current
   inserts.
2. Always attempt to watch global first task
   This should try to prevent multiple scheduler threads from
   waiting on the same task. If the global first task is our task,
   then we can avoid retrying for the next task.
3. Correctly set runner state to TASKS when parsing intermediate
   tasks. This will prevent the runner from being interrupted
   by notifyTasks.
2025-04-03 15:37:31 -07:00
Spottedleaf
7452818d16 Add new tick region scheduler
The old region scheduler had a few problems:
1. Inability to process intermediate tasks (chunk/packets) leading
   to higher than Paper/Vanilla latencies for task processing
2. Thread swapping: scheduled tasks had no thread preference, which
   lead to them swapping threads which may not be cache efficient

The new scheduler solves both of these issues. The new scheduler
can process intermediate tasks, and combined with the new packet
scheduler this allows packets to be processed at low latency
provided that the scheduler threads are idle or waiting.

The new scheduler will only move a scheduled tick/task to another
scheduling thread provided that its scheduled start is missed by
a specified time (for now, 2ms). This should ensure that thread
swapping only occurs to meet scheduling deadlines.
2025-04-03 15:37:31 -07:00
Spottedleaf
2986741444 Update Paper 2025-04-03 15:34:54 -07:00
Spottedleaf
bc157c78bc Update Paper 2025-03-20 12:56:40 -07:00
Spottedleaf
d3969cdc41 Update Paper 2025-03-09 12:50:14 -07:00
Spottedleaf
d4cf71c327 Update Paper 2025-03-08 06:39:17 -08:00
Spottedleaf
4b4c10cfc0 Update Paper 2025-02-27 22:48:16 -08:00
Spottedleaf
e39039dd11 Update Paper 2025-02-17 15:51:04 -08:00
Spottedleaf
32c2b33dcc Update Paper 2025-02-16 12:23:20 -08:00
Spottedleaf
d17fb532f1 Move file patches to feature patches
This is to assist in updating upstream, as the current file patch
system is brittle and fails to handle conflicts well.
2025-02-16 12:17:53 -08:00
Spottedleaf
b54ba0d75b Remove nearbyPlayers cache on ChunkData
We cannot guarantee that the current region owns the chunk
associated with the ChunkData. As a result, more than 1 region
may write to the field.

Additionally, we did not include any logic to adjust the field during
a region merge or split - which would leave invalid data in the field.

As a result, the nearbyPlayers data retrieved from the ChunkData
was possibly invalid which may have lead to entity tracker desync
problems.

Fixes https://github.com/PaperMC/Folia/issues/317
2025-01-20 04:56:56 -08:00
Spottedleaf
0acb7b08b7 Split Minecraft patches into file patches 2025-01-11 06:45:50 -08:00
Spottedleaf
b1da93e90b Resolve notes 2025-01-11 06:36:44 -08:00
Spottedleaf
838465ab24 Begin hard fork 2025-01-11 05:26:16 -08:00