I've been reading a lot about concurrent programming as well as watching a lot videos online, but I still can't understand one big idea. Provided that a piece of software is written correctly and is not executed on a mulit-core processor (i.e. it runs on a single core machine) why is concurrent program runs faster than a sequential one? I keep trying to figure it out but I really can't understand.
It's not. The argument for writing concurrent code for single processors wasn't on the grounds of speed, it was about organization of tasks. It's cleaner to have different tasks handled by different threads with switching between them done by the OS, otherwise the application has to juggle the tasks itself. Data for a task can be confined to a thread and kept separate from other tasks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With