3 ms·
> That's not a bad restriction in practice. Maybe, but it surely is inconvenient! When our program can use pipe-line with several pipelines for concurrency (
by lelanthran 4y ago
> That's not a bad restriction in practice.
Maybe, but it surely is inconvenient!
When our program can use pipe-line with several pipelines for concurrency (like GPU shaders work), sure, that's a good way to go. However the majority of what threads are doing is not pipe-line friendly work.
When we want our program to do different things at the same time (which is what we mostly use threads for), trying to do it in a pipe-line-like manner won't work.
For example, serving multiple http requests at the same time - some will be a POST to an API endpoint, some will be a GET for a static file, some controller code will make multiple requests to different backend microservices (each request in a different thread), etc.
Or maybe some client code, that makes several concurrent requests for different resources to different destinations, while each thread still needs to update the UI (progress meter, for example).
Or a parser for input from some upstream processes: you want to parse in parallel if at all possible.
Or the program in a microcontroller that cannot miss bytes coming in on one bus while it is sending bytes out on another bus.