Implement preemptive threading