|
Thinking In C++. Volume 2: Practical ProgrammingAn underlying mechanism is actually dividing up the CPU time for you, but in general, you don’t have to think about it, which helps to simplify programming with multiple threads. A process is a self-contained program running with its own address space. A multitasking operating system can run more than one process (program) at a time, while making it look as if each one is chugging along on its own, by periodically switching the CPU from one task to another. A thread is a single sequential flow of control within a process. A single process can thus have multiple concurrently executing threads. There are many possible uses for multithreading, but you’ll most often want to use it when you have some part of your program tied to a particular event or resource. To keep from holding up the rest of your program, you create a thread associated with that event or resource and let it run independently of the main program. Concurrent programming is like stepping into an entirely new world and learning a new programming language, or at least a new set of language concepts ...» |
Код для вставки книги в блог HTML
phpBB
текст
|
|