Multithreading doesn’t always provide a benefit. Take the following TODO list:
1. Buy Groceries
2. Pick up child from school
3. Drop off child at soccer practice
If you had a friend to help you out with this list, #1 and #2 can be done at the same time, but #2 and #3 need to be done sequentially by the same person, so any more than 2 people working on this TODO list would be useless.
It’s the same with code. Some algorithms are easy to split into multiple “threads,” that can run at the same time, while some parts of the code either need to be run sequentially, or the small benefit of splitting it up isn’t worth the effort and added complexity.
Latest Answers