Multithreading: What is the point of more threads than cores?

后端 未结 17 938
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-29 16:24

I thought the point of a multi-core computer is that it could run multiple threads simultaneously. In that case, if you have a quad-core machine, what\'s the point of having

17条回答
  •  一生所求
    2020-11-29 16:55

    Although you can certainly use threads for speeding up calculations depending on your hardware, one of their main uses is to do more than one thing at a time for user-friendliness reasons.

    For example, if you have to do some processing in the background and also remain responsive to UI input, you can use threads. Without threads, the user interface would hang every time you tried to do any heavy processing.

    Also see this related question: Practical uses for threads

提交回复
热议问题