9. Thread



Objects provide a way to divide a program up into indepedent sections.  Often, we also need to turn a program into separate, independently-running subtasks.

Program: static code
Process: running program
Thread: lightweight process

By far, all program we demonstrated are one thread program.

A mutil-thread program is a program that more than one thread are excuting at one time.


Next Page