This article is only a personal understanding of the Java thread, as well as the learning record, if not the place also ask. I am looking for a reasonable answer.
What is an operating system? (See Interactive encyclopedia)
The operating system (Operating system, or OS) is a computer program that manages and controls computer hardware and software resources, is the most basic system software that runs directly on "bare metal", and any other software must be run with the support of the operating system.
What does the operating system do? (See Interactive encyclopedia)
The operating system is the interface between the user and the computer, but also the computer hardware and other software. The functions of the operating system include the management of computer system hardware, software and data resources, control program operation, improve human-machine interface, to support other application software, so that all the resources of the computer system to maximize the role, to provide a variety of forms of user interface, so that users have a good working environment, Provide necessary services and corresponding interfaces for the development of other software. In fact, the user is not exposed to the operating system, the operating system manages the computer hardware resources, while according to the application of resource requests , allocating resources , such as: dividing the CPU time, the opening of memory space, call printer and so on.
What is CPU time? (csdn:free365 answer)
Time slice rotation Scheduling is one of the oldest, simplest, fairest and most widely used algorithms for time-slice scheduling. Each process is assigned a time period, called its time slice, which is the time that the process is allowed to run. If the process is still running at the end of the time slice, the CPU is stripped and assigned to another process. If the process blocks or ends before the end of the time slice, the CPU switches immediately. What the scheduler has to do is maintain a list of ready processes that are moved to the end of the queue when the process runs out of its time slice.
The only interesting point in time-slice rotation scheduling is the length of the time slice. It takes time to switch from one process to another-saving and loading register values and memory images, updating various tables and queues, and so on. If the process switch-sometimes called context Switch-takes 5 milliseconds and then assumes that the time slice is set to 20 milliseconds, the CPU will spend 5 milliseconds to process switching after 20 milliseconds of useful work. 20% of CPU time is wasted on administrative overhead.
To improve CPU efficiency, we can set the time slice to 500 milliseconds. The time wasted was only 1%. But in a time-sharing system, what happens if 10 interactive users press ENTER almost simultaneously? Assuming that all other processes are using their time slices, the last unfortunate process has to wait 5 seconds to get the chance to run. Most users cannot tolerate a short command for 5 seconds to respond. The same problem can occur on a personal computer that supports multi-channel programs.
What is a process?
Cond............
Java Multithreading-Basic knowledge