3 ms·
Cooperative multithreading might have lower overhead, as it saves the trips from and to kernelspace, if handled by the application and by that can be assumed to
by guenthert 6y ago
Cooperative multithreading might have lower overhead, as it saves the trips from and to kernelspace, if handled by the application and by that can be assumed to be more efficient, which might be significant when there is a high rate of thread scheduling events. I don't see how it improves on latency, i.e. the delay between an external stimuli and the expected reaction to it. The maximum latency for cooperative multi-threading is in the general case unbounded and hence unsuitable to low-latency applications, much less for real time application.
- quietbritishjim 6y agoI'm not sure if this is what the parent was referring to, but one way that it might have lower latency is if you have multiple strands / threads dealing with different bits of the system, with queues to pass messages between them. In a truely threaded application, handing data from one to another using a queue requires the new thread to be scheduled by the OS (unless the target thread is so busy that it pops the item off the of the queue immediately after handling the previous item). In a single-threaded async design, if the workload is light then, after the first strand adds an item to the queue and yields control, the second strand might pop the item off and deal with it immediately in the same time slice.
- deleted 6y ago[deleted]