You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A lot of places call ThreadPool.QueueUserWorkItem() to offload tasks to a different thread, this is usually done to make sure tasks like model vertex calculations or texture loading don't block the network or render/update loop. However, this is being done in so many places that the threadpool gets a backbuffer of queued up items. Causing stuff like chunk updates, entity ticking etc not to be executed within a reasonable amount of time.
The Solution
First we should determine what tasks are currently being executed on the threadpool, we can then determine a fit solution for those items.
I imagine a lot of these can probably just be queued up to a BackgroundWorker instance. This will allocate 1 thread to process all of the queued items instead of taking up all of the threadpool threads.
This discussion was converted from issue #104 on December 21, 2021 23:42.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The Issue
A lot of places call
ThreadPool.QueueUserWorkItem()
to offload tasks to a different thread, this is usually done to make sure tasks like model vertex calculations or texture loading don't block the network or render/update loop. However, this is being done in so many places that the threadpool gets a backbuffer of queued up items. Causing stuff like chunk updates, entity ticking etc not to be executed within a reasonable amount of time.The Solution
First we should determine what tasks are currently being executed on the threadpool, we can then determine a fit solution for those items.
I imagine a lot of these can probably just be queued up to a BackgroundWorker instance. This will allocate 1 thread to process all of the queued items instead of taking up all of the threadpool threads.
Any input on this problem is more than welcome!
Beta Was this translation helpful? Give feedback.
All reactions