If you use cooperative multitasking and have a bad program: then yes, you are right.
However in the real world the following is supposed to happen:
Cooperative multitasking: I tread does not keep using the CPU forever. Instead it will either give another program a chance after some time or when it is blocked.
Paul's answer describes the latter.
Preemptive multitasking (used just about everywhere): The OS (not the program) will give the CPU for short period of time to a program, and then take it away. This can be as simplistic as running a timer and once that expires stopping the process and giving it to the next tread/program which is waiting.
In your case think of it as an office with two workers and three (or more) tasks.
(Lets call them task-A, task-B and task-C).
The first worked checks the supervisors orders which state:
- Set a timer 10 minutes. When it goes off stop working on your current task, put it at the bottom of the TODO list and continue reading this document.
- Next remove the first item from the top of the TODO list and start working on it.
Worker 1 set the timer and gets the first task of the TODO list (in this case that is task-A).
Worker 2 does the same thing: It sets a timer and gets what is now from the top of the TODO list. Since worker 1 removed task-A from it worker 2 now starts on task-B.
Ten minutes later the timer goes off. Worker 1 stops working on Task-A and gets the supervisors instructions. Those state to put the current task at the bottom of the TODO list. Continuing the supervisor's instructions it now restarts the timer and start to work on what is now at the top of the TODO list (which is task-C).
Worker 2 does the same and stops task-B and starts with the top of the TODO list (which in the example is task-A)
This is somewhat simplified. But it should give you an idea how two treads (workers) can work 100% of the time on three or more tasks.
In real schedulers there are many more things. E.g. interrupts (compare it to a phone ringing in the middle of a task and how to handle that), smart scheduling (giving the same task to the same worker will likely result in it getting done faster since the worker is already familiar with it), I/O (if a worker needs a book from a library (s)he will not wait until the timer expires, but immediately continues with the next task, etc etc.