Adobe interview question

write code for a thread scheduler