Compile and run with threads