Will we ever have access to the number of threads available? And will we ever have access to manually assigning jobs to specific threads?
In my situation, I want to evenly distribute a set amount of jobs that take a varied amount of time (which I have a rough estimate for). Back on the main thread, it will yield until all jobs are completed to then handle the processed data. I’m not exactly sure how Roblox determines what runs on what thread, but I don’t believe they are going to have better distribution than me (considering I know how long each job will take). The main problem with this is that I could have 20/28 jobs already completed on 11/12 threads, while that 1 final thread still needs to process 8 more jobs.
Are there any plans to address a situation like this?
EDITS: Just to clarify, each job isn’t taking 4-5 seconds and yielding inside, it’s performing calculations and I have a good estimate of how long it will take to process.
Technically each Actor is a thread, but if you have more actors than threads, Roblox will start doing some dynamic distribution? This means that if we have access to the number of threads on the user’s system, we also have the ability to control job distribution?
I just want to add that it would be super helpful to have a RunService:IsThread()
function, or at least something similar to see what environment the code is currently running in.