fork() in Mono

Gene Thomas <[email protected]> Mon, 4 Dec 2017 14:23:34 +1300
Newsgroups gmane.comp.gnome.mono.devel
Message-ID <CAJQLTU44sXiPLAbB1R6fTLUAO+krGuoe7EviQS7gm_Q84RRN-Q@mail.gmail.com>
Hello,

I have noticed that in mono/mcs/class/Mono.Posix/Mono.Unix.Native/Syscall.cs
<https://github.com/mono/mono/blob/master/mcs/class/Mono.Posix/Mono.Unix.Native/Syscall.cs>
 fork() is #if'd out with the message "*DO NOT directly call fork(2); it
bypasses essential shutdown code. Use System.Diagnostics.Process instead*".

What happens specifically? fork() starts a process, it does not shut
anything down? fork() should just work, does it not (effectively (copy on
write)) copy the entire VM which then each shuts down independently?
fork() does
work in Python on Unix (multiprocessing module).

fork() is powerful, it supports using processes as an alternative to
threads. One can not test for a one in a million race condition.
System.Diagnostics.Process only replaces fork() then exec(). I wish to use
fork() to support replicated processes, starting with a complete copy of
the application's state greatly simplifies this.

Thanks,


Gene Thomas.

+64 21 436384 <+64%2021%20436%20384>
[email protected]

_______________________________________________
Mono-devel-list mailing list
[email protected]
http://lists.dot.net/mailman/listinfo/mono-devel-list