in reply to Re^8: Fork and creating a thread exits the process
in thread Fork and creating a thread exits the process
Great. Now you need to figure out why mine works but yours doesn't. Either start with yours and slowly take things out to simplify toward mine, until it starts working; or start with mine and slowly add things to make it more like yours until it stops working.