Use context switch instead of sleep