Are single-threaded applications a dead technology

2020-06-03 04:49发布

I just bought a new, sub-US$1,000 laptop, one aimed squarely at the consumer, non-developer market and, looking over the specs, was surprised to find that it came standard with a dual-core processor.

This led me to the question: with multicore machines becoming the norm, is it ever correct to write a single-threaded application anymore?

Excepting trivial applications, which can reasonably be expected to fit entirely within a single core of a single processor of the weakest system on which it will run, will an application which runs in all one thread be seriously degraded by the way modern OSs spread their execution across cores when no guidance is given by the application as to how to optimize such a split?

13条回答
Root(大扎)
2楼-- · 2020-06-03 05:16

Multi-threaded applications are significantly more difficult to write, and maintain. I think you will start seeing more applications which leverage multi-threading thanks to advances in both hardware, but also in advances in the technology stack.

Microsoft has a set of extensions that I believe are being added into the runtime called ??Parallels?? I know they call the LINQ enabled version PLINQ. Essentially it tries to remove a lot of the error prone plumbing from multi-threaded algorithims.

Only time tell however, and I would wager there were still be plenty of single threaded applications out there because they won't algorithims that justify the performance cost of spinning up threads.

查看更多
登录 后发表回答