3 ms·
Unix generally favors processes over threads, at least the old school Unix. Threads are a more recent innovation. The old approach was that programs don't need
by dale_glass 3y ago
Unix generally favors processes over threads, at least the old school Unix. Threads are a more recent innovation.
The old approach was that programs don't need internal parallelism because you can get it by just piping stuff and relying on the kernel's buffering to keep multiple processes busy.
Eg, tar is running on one core dealing with the filesystem, gzip is running on another core compressing stuff.
In the early days, Windows would have a single program doing everything (eg, Winzip) on a single core, while Unix would have a pipeline with the task split into multiple programs that would allow for this implicit parallelism and perform noticeably better.
Today this is all old and doesn't cut it anymore on 128 core setups.
- saagarjha 3y agoWell, if you split the file into chunks you could fan it across cores by compressing each individually.
- frde 3y agoHaving to do things like this is exactly the problem.
- loeg 3y ago“Recent” as in the 80s or 90s, sure. Threads are older than unix was when threads were introduced.
- fnordpiglet 3y agoI’m not sure I understand. Typically I’ve thought of threads called “threads” being formalized with POSIX threads. Before that, while my memory is vague on this, it was just lumped into multiprocessing under various names.
- loeg 3y agoEven if you ignore threading models prior to pthreads, pthreads itself dates to 1995.
- fnordpiglet 3y agoAnd Unix 1973
- loeg 3y agoSo: Unix was ~22 when Pthreads were introduced in 1995, and Pthreads are 28 years old now.
- wanttocomment 3y agoI agree with most of these points except blaming this on processes vs threads. The only difference is all memory being shared by default, vs explicitly deciding what memory to share. With all the emphasis on memory safety on HN you think this point would be appreciated.
- fnordpiglet 3y agoThat’s fairly new, with threads and processes becoming basically the same. Historically threads didn’t exist, then they were horrifically implemented and non standard, then they standardized and were horrifically implemented, then they were better implemented but the APIs were difficult to use safely, etc etc. Also threads were much more light weight than a process. This shifted with light weight processes, etc.
- wanttocomment 3y agoThat's true, but if you're looking that far back, multicore is new too
- fnordpiglet 3y agoI guess “that far back” becomes different as you get older :-) it doesn’t seem that long ago to me :-)
- mhh__ 3y agoProcesses can still be fine. If you're lucky you can be debating over whether you'd like something to be 99x or 100x faster.