A simple implementation of threads.