Add threads and a preemptive priority scheduler