This PR should fix MC-183518. The current implementation in BlockableEventLoop involves yielding the thread before parking, which is unnecessary and can lead to inefficient thread scheduling and higher CPU usage.
Changes made:
Replaced the existing thread yielding logic with LockSupport.parkNanos to directly park the thread for 2 milliseconds.
Reasoning:
Yielding the thread is redundant if the thread is about to be parked immediately afterward.
This PR should fix MC-183518. The current implementation in BlockableEventLoop involves yielding the thread before parking, which is unnecessary and can lead to inefficient thread scheduling and higher CPU usage.
Changes made:
LockSupport.parkNanos
to directly park the thread for 2 milliseconds.Reasoning: Yielding the thread is redundant if the thread is about to be parked immediately afterward.
Reference: