|Did you know ...
vfork. If the method is
but this cannot be used because it is either not supported by the OS
cwd(Dir) option is given
fork is used.
The problem is to be understood as follows. The official portable
and safe method to create a process is using the
fork() system call.
This call however copies the process page tables and get seriously
slow as the (Prolog) process is multiple giga bytes large.
Alternatively, we may use
vfork() which avoids copying the process
space. But, the safe usage as guaranteed by the POSIX standard of
vfork() is insufficient for our purposes. On practical systems your
mileage may vary. Modern posix systems also provide
which provides a safe and portable alternative for the
exec() sequence that may be implemented using
fork() or may use a
fast but safe alternative. Unfortunately
support the option to specify the working directory for the child
and we cannot use working_directory/2 as the working directory is
shared between threads.
Summarizing, the default is safe and tries to be as fast as
possible. On some scenarios and on some OSes it is possible to do
better. It is generally a good idea to avoid using the
option of process_create/3 as without we can use