threads
threads copied to clipboard
Priority for threads
I would need to mark several threads that run a lot of time (minutes, even hours) as having minimum priority. I have not found anything in the threads proposal about this issue.
The MVP for threads uses an unspecified host facility to actually create the threads (for browsers this is standard dedicated workers, ie the Worker API) so you'd want to look into what the host you're considering is offering (for the Worker API there's nothing, so far as I know).
Post-MVP, when we move to real threads, I would expect a priority API to appear too.
Yes, you are correct. I have a factorization calculator that runs several minutes in the Web browsers (some people are running it for more than a day), but it has the same priority than other processes in the system, which is not good. I would need the calculator to have with lower priority so it runs only in the idle time thus not affecting other processes.
It appears that there is no way to reduce the priority for a Web Worker.
I think we'd need to rope in a group such as web performance for this.