Simple threads implementation.