Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are single-threaded applications a dead technology? [closed]

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?

like image 778
Yes - that Jake. Avatar asked Jan 08 '09 16:01

Yes - that Jake.


2 Answers

Since threading always adds extra complexity to applications, I believe that single threaded applications will always have their place.

Not even when single core processors are completely obsolete will single threaded programming be gone.

Dual cores, especially in the consumer market, are great for multitasking. If every app takes every processor core it possibly can we will run into the same problems we had with single core processors.

I say don't go nuts and start mulithreading everything. Keep it in one thread unless there is a good reason not too.

like image 200
jjnguy Avatar answered Sep 22 '22 17:09

jjnguy


You shouldn't be multi-threading unless the application needs to be multi-threaded.

Just because you can multi-thread doesn't mean you should. Multiple cores/processors doesn't really change this fact.

like image 27
GEOCHET Avatar answered Sep 23 '22 17:09

GEOCHET