#Threading issues

24 messages · Page 1 of 1 (latest)

noble nova
burnt crownBOT
#

This post has been reserved for your question.

Hey @noble nova! Please use /close or the Close Post button 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.

still vapor
#

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

noble nova
still vapor
#

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?

noble nova
#

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
                }
            }
still vapor
#

What's mspt?

noble nova
#

millisecond per tick

still vapor
#

oh some Minecraft specific thing

#

How are you currently waiting for tasks?

noble nova
#

budget is 50ms and it completes in 7 seconds

still vapor
#

Why aren't you just using ExecutorService to submit tasks?

still vapor
noble nova
still vapor
#

As I said, you can make it use priorities

noble nova
#

it got rejected for an unknown reason for me
message search shows last PriorityBlockingQueue reference has been written in 2021

still vapor
#

If you want an efficient implementaton, use ExecutorService

burnt crownBOT
#

💤 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.