[Info-vax] Looking into C-include files on VMS
JF Mezei
jfmezei.spamnot at vaxination.ca
Mon Nov 9 17:48:56 EST 2009
MetaEd wrote:
> Threads share one data space, whereas what you want with fork() is a
> duplicate data space.
So, with the "process in a thread", what you do is that you duplicate
the memory space within the main process so that 2 threads have
initially identical memory VALUES but at different locations, so the
second "pseudo process" can modify its own memory without mucking with
the first process's memory. And this would still allow the sharing of
the io space etc.
However, I just realised that virtual memory would be the same for both
threads. So when you duplicate the process into another thread, all the
pointers in memory etc would still point to virtual memory values that
are mapped to the first process.
Getting a different process allows the virtual mapping to be different
so that the same value in a pointer can be mapped to a different
location in physical memory.
More information about the Info-vax
mailing list