I have looked into the code of posix-spawn( https://github.com/rtomayko/posix-spawn), it seems that it uses vfork in the low level implementation.However, vfork is not encouraged to use in linux platform.Is it ok with posix-spawn module ?
I have looked into the code of posix-spawn( https://github.com/rtomayko/posix-spawn ), it seems that it
Share
vforkisn’t recommended because it heavily restricts what the new process can do (until itexecs) and is consequently hard to use correctly. On Linux,forkuses copy-on-write semantics, soforkis going to be reasonably fast without needing to usevfork. Furthermore,vforksignal semantics are not at all standard across platforms. Fromman vfork:That said, if used properly,
vforkcan be useful, and it will be faster on many other platforms. Linux does support it, so provided the code doesn’t do anything that is restricted byvfork, it should be just fine on Linux.