nim-daemon icon indicating copy to clipboard operation
nim-daemon copied to clipboard

advantage over using poDemon with startProcess?

Open timotheecour opened this issue 7 years ago • 4 comments

would be nice to make that clear in readme.md

timotheecour avatar Jul 05 '18 17:07 timotheecour

First of all poDemon inside of osproc.nim is different. So if you will use nim-daemon on Windows, it will start clone of your process which will be running on background, detached from console, so it will be almost equal to Unix daemonization, while Nim's osproc is just creates new process without console window, and it will be terminated when parent exits.

cheatfate avatar Jul 05 '18 19:07 cheatfate

ok thanks; how about on posix (osx, linux)?

timotheecour avatar Jul 05 '18 20:07 timotheecour

On Posix systems it uses old algorithm of daemonization, so your process will be detached from parent, which execute it and will continue running in the background, while poDemon is starts new process group, and then execv this new process (so nim-daemon achieves same result, but with less number of syscalls - only one fork()). So main use-case of poDemon inside of osproc.nim is to start new custom process detached from parent. While nim-daemon is library which allow to detach your own process from parent.

cheatfate avatar Jul 06 '18 05:07 cheatfate

thanks! these answers would be great in the repo's readme.md

timotheecour avatar Jul 06 '18 07:07 timotheecour