4 ms·
I'm unfamiliar with this, is "coop multithreading" basically equivalent to Windows 3.1 style coop multitasking, where a thread can hang the whole application by
by AtlasBarfed 1y ago
I'm unfamiliar with this, is "coop multithreading" basically equivalent to Windows 3.1 style coop multitasking, where a thread can hang the whole application by ... not cooperating?
Does anyone here remember Windows 3.1?
- dathinab 1y agoyesn't both are forms of cooperative multi tasking/threading but there are a many differences about what you expect how exactly it is implemented and most relevantly you run the cooperative tasks on a pool of OS threads which are preempted, so a single thread hanging won't hang your whole application. And dev tooling has gotten much better since then, that helps a lot too. also Windows 3.1 kinda predates me, so no not really PS: And JS in the browser still uses cooperative multi tasking and the whole website hanging isn't exactly the norm ;) Partially because you can opt for preempted threads (worker) which also happend to not be good at handling termination. And partially because a lot of iff overhead logic is moved outside of web apps and into the browser itself (e.g. layout, rendering etc.). It's pretty common to setup one such worker and then use message passing to send work to it, but this means that between concurrent tasks there is no preemption and on way to handle arbitrary numbers concurrent requests with a very limited number of workers is to make each worker internally use cooperative multi tasking. So we are kind back at cooperative multi tasking on top of preempted OS threads.