Task

Spawn a new process which can run simultaneously with, and independently of, the original parent process.




local posix = require 'posix'
 
local pid = posix.fork()
if pid == 0 then
    print("child process")
elseif pid > 0 then
    print("parent process")
else
    error("unable to fork")
end