Threading vs single thread

前端 未结 8 963
清歌不尽
清歌不尽 2020-12-04 13:32

Is it always guaranteed that a multi-threaded application would run faster than a single threaded application?

I have two threads that populates data from a data so

8条回答
  •  醉酒成梦
    2020-12-04 14:20

    I've seen real-world examples where code has performed so badly with more processors added (horrible lock contention amongst threads) that the system needed to have processors removed to restore performance; so yes, it is possible to make code work worse by adding more threads of execution.

    IO constrained apps are another good example, mentioned above.

提交回复
热议问题