parallel thread functions and test
removed die from main.c, its in util.c now