How does multithreading take place on a computer with a single CPU?
It is the responsibility of scheduler to organise multiple tasks by allocating execution time to each task, in such a way that it seems to be executed in a sequential fashion to rest of the world.