--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-dev/54baf176-2123-4166-a9a1-6f1d14c9ecb8%40googlegroups.com.
*onlyThe Oracle docs are incorrect about POSIX, as their docs state:
The addition of the forkall() function to the standard was considered and rejected. The forkall() function lets all the threads in the parent be duplicated in the child. This essentially duplicates the state of the parent in the child. This allows threads in the child to continue processing and allows locks and the state to be preserved without explicit pthread_atfork() code. The calling process has to ensure that the threads processing state that is shared between the parent and child (that is, file descriptors or MAP_SHARED memory) behaves properly after forkall(). For example, if a thread is reading a file descriptor in the parent when forkall() is called, then two threads (one in the parent and one in the child) are reading the file descriptor after the forkall(). If this is not desired behavior, the parent process has to synchronize with such threads before calling forkall().The Oracle docs talk about fork() in conjunction with multi-threaded processes in quite a bit of detail at https://docs.oracle.com/cd/E19120-01/open.solaris/816-5137/gen-1/index.html and the concerns with forkall()and many OS’s implement it, including Solaris, UniwWare, FreeBSD.
On Jul 26, 2019, at 2:17 PM, Robert Engels <ren...@ix.netcom.com> wrote:
-----Original Message-----
From: Jan Mercl <0xj...@gmail.com>
Sent: Jul 26, 2019 1:37 PM
To: fmar...@gmail.com
Cc: golang-dev <golan...@googlegroups.com>
Subject: Re: [golang-dev] Why golang doesn't have the `fork` syscall ?
On Fri, Jul 26, 2019 at 8:15 PM <fmar...@gmail.com> wrote:I was wondering what is the technical reason for not having direct support for doing a `Fork` sys call.
Unix supports forking of only single threaded processes.
--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golan...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-dev/CAA40n-WS%2Bw43f-DvX0PXXrzmMiaTbSUKzXBO%3DGM2%2BwYi5RDjPQ%40mail.gmail.com.
Kind of related but today we talked about jruby (Ruby on the jvm) implementation of fork. Doesn't seem to be supported.