<p>Am 14.04.2017 09:23 schrieb "Michael Schnell" <<a href="mailto:mschnell@lumino.de">mschnell@lumino.de</a>>:<br>
><br>
> On 12.04.2017 14:09, Lars wrote:<br>
>><br>
>> If unix could just make processes even lighter weight or<br>
>> faster loading, I might avoid threads and just use processes...<br>
><br>
> in Unix/Linux processes are not less "light" then threads. You can create a process by "fork". no "Loading" involved. it just creates the process. If you want to have the new process execute any code that is not shared with the you need to do another system call to replace the code with the new one. Moreover even if "loading" new code - in case another process already runs this file, no actual loadingĀ  takes place, either, as the memory management just uses the code page already in RAM.<br>
><br>
> This definitively is as light as it gets.</p>
<p>A process definitely is less "light" than threads even on Unix systems: a process has its own address space (even if it shares all pages with its parent process) and also structures keeping track of the used resources (e.g. open file descriptors). A thread does not need all this as it always shares the same address space and the same resources.<br>
Why do you think the concept of threads was introduced in Unix? Early Unix systems only had processes.</p>
<p>Regards,<br>
Sven</p>