I want to run a C function in background but I want it to keep it running when the main
function exits.
I tried following:
pthread_detach
, a detached thread exits if themain
function callsexit()
instead ofpthread_exit
.deamon()
: It runs the code in background but not in parallel.
So, what is the simplest way to run a C function in parallel/background even after my main
function exits?