One.
Look at the multithreading technology is very good, why not all use multithreading to solve the problem?
Multithreading is a disadvantage, in which is really at the same time executed?
Windows itself is a multitasking operation of the operating system, who is responsible for the execution of the program, CPU. The CPU runs in the memory-responsible program. How does it know to run? The CPU is doing a quick switchover between multiple tasks, particularly fast, as if it were executing more than one program at a time, and in fact there is only a single execution path executing at one point.
When the program is running for a long time, each program is processed by the CPU frequency is slow, it is processed the probability of becoming lower, the final execution of the duration of the extension.
Think about it, can you improve this efficiency? Very simple, 2 CPU is done. 2 CPUs occupy the motherboard space. Multiple CPUs can be executed at the same time in real sense.
Multithreaded technology does help us solve problems that multiple programs need to execute at the same time. We learn the procedure is to solve the problem, all can solve what problem? Simultaneous execution of multiple programs. But it has disadvantages, open more, low efficiency. A lot of threads, too busy to crash. What are the biggest benefits of true dual-core and four-core CPUs? Memory.
CPU switching is random, who depends on it? Time slices.
Fast switching at the same time makes it possible to see multithreaded technology.
Java-Preliminary Understanding-The 12th chapter-Multi-line benefits and drawbacks