I just hit the Concurrency in Action book which describes that the actial key for the performance is the number of hardware threads. But I know that there were multithreaded programms and applications on old, single cored machines.
So does it make sense to write concurrent program if you have exactly 1 hardware thread?
Asked
Active
Viewed 163 times
3

Eduard Rostomyan
- 7,050
- 2
- 37
- 76
-
Yeah I know, just could not help myself posting the question. – Eduard Rostomyan Mar 07 '18 at 10:24
-
3Yes, it still makes sense for some applications. You want your GUI to be always responsive so if your app does a lot of background processing, you better put that code in a separate thread (this will normally execute only when the main thread is idle/inactive) – dsp_user Mar 07 '18 at 10:28
-
1Multi-processing has existed on single processor machine since at least the 70'. And it was invented because it made sense. A process (or a thread) can be blocked waiting for slow IO, so the processor can do something other during that time. That's the reason why CPython provided threading, even if the Global InterpreterLock only allows one thread at at time. And it is indeed useful for IO bound processes – Serge Ballesta Mar 07 '18 at 10:31
-
1There is [tag:langiage-agnostic] when you want to ask questions not tied to a single language. Don't spam tags – Passer By Mar 07 '18 at 10:36
-
@PasserBy, edited accordingly. – Eduard Rostomyan Mar 07 '18 at 10:38
-
1This question has probably been asked before, but the "duplicate" that got this put on hold is not the same question. -- I can give a real life example. I designed a robot controller (for computer-wafer handling in fabs). One CPU. It had one thread dedicated to realtime control of a multi-channel servo amp. When that thread was blocked waiting for a response from the servo, via a network card, another thread was processing commands from a host computer and calculating trajectories. The instant the servo response came back, the RTOS gave the CPU to the realtime thread. First things first. – Jive Dadson Mar 07 '18 at 10:48