How to fix this threading issue that exists only on Windows?
https://spark.lucko.me/FlCb0anrpw
#Threading issues
24 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @noble nova! Please use
/closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
What about that would be an issue?
It tells you that most threads are waiting most of the time meaning there is no work these threads have to do which is perfectly fine
server suffers huge server lag spikes because we have to wake up sleeping io threads
example: we have one sudden job to complete and io threads are sleeping at this moment
Sure that waking up these threads is the issue?
and not it just doing other work before waking up the threads?
If so, what makes you sure?
well, i have to apologize first, im not a dev.
additional information:
we added spinwait in order to fix world saving times on windows, but this introduced mspt spikes when opening loot chest in shipwreck which contains treasure map and we reverted it.
// attempt to spin-wait before sleeping
if (!pollTasks()) {
Thread.interrupted(); // clear interrupt flag
for (int i = 0; i < 5000; i ++) {
if (pollTasks()) continue main_loop;
LockSupport.parkNanos("Spin-waiting for tasks", 10_000); // 100us
}
}
What's mspt?
millisecond per tick
budget is 50ms and it completes in 7 seconds
probably show the code would be the best option for me...
https://github.com/RelativityMC/FlowSched/tree/491bc6a731b724d44072bfb7d51eea3433214cb6
Why aren't you just using ExecutorService to submit tasks?
These are well-tested performant ways to manage tasks
With that, you can use PriorityBlockingQueue for ensuring priorities
because it is too basic for us
What capabilities are you missing?
As I said, you can make it use priorities
it got rejected for an unknown reason for me
message search shows last PriorityBlockingQueue reference has been written in 2021
If you want an efficient implementaton, use ExecutorService
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use/help ping.
Warning: abusing this will result in moderative actions taken against you.