Use thread instead of fork, etc