[fpc-pascal] Threading vs Parallelism ?
mschnell at lumino.de
Wed Apr 19 10:28:33 CEST 2017
On 14.04.2017 09:36, Sven Barth via fpc-pascal wrote:
> A process definitely is less "light" than threads even on Unix
> systems: a process has its own address space
Not really true (see below).
> Why do you think the concept of threads was introduced in Unix? Early
> Unix systems only had processes.
Because if you do something that is usually called "Thread" you _want_
shared memory in the same address space, not because of that being
"light" but because the way you want to handle your memory based objects
in your user code needs this.
In fact the "real" difference between Threads and processes (i.e. the
Kernel knows that a processing entity is supposed to be a "Thread"
associated with other threads of a process) in Linux only had been
introduced with the "Native POSIX Thread Library" ("NPTL") ->
https://en.wikipedia.org/wiki/Native_POSIX_Thread_Library. Before NPTL,
you just used processes for your threads telling the system that for the
new thread you wanted a shared address space.
Again (AFAIK) NPTL had not been introduce to make threads "lighter" but
to allow for threads behaving in a decently POSIX compatible way (e.g.
the threads of a process getting only a common share of time slices).
More information about the fpc-pascal