Python's concurrent programming (a) an overview of the process and the operating system

Overview of process and operating system

  1. The basic process

    • Procedures and processes:

      Program is a bunch of static code files

      It is a process that is running the program, abstraction

      Call control process by the operating system to run CPU

  2. operating system

    • Relationship management control to coordinate computer hardware and software

    • The role of the operating system:

      • The complex ugly interface hardware operations into a simple beautiful interface. Open function.

      • When multiple processes to seize a (CPU) resources, your operating system will become reasonable and orderly execution.

        阻塞: input read write sleep recv accept sendto recvfrom .....

  3. History of operating system development

    1. Computers first appeared: abacus.

    2. History of the development of computer electronics:

      1. First computers 1940 ~ 1955

        • There was room in the university, I want to use the computer must make an appointment.

          Connect the various hardware formulation, 1.5 hours, vacuum, and then plug in program debugging. Inefficiencies

        • Advantages: Exclusive entire personal computer resources.

        • Cons: hardware debugging plug wire, time-consuming, all are serial execution

      2. Second generation computer tape storage system 1955 to 1965 --- Batch

        • advantage:
          • Programmers do not personally hardware plug wire control, improve efficiency
          • You can perform batch processing code
        • Disadvantages:
          • In other words you can not use a computer program alone
          • Your desired program or serial
      3. Third Generation Computer: integrated circuits, multiprogramming system

        • Large background:

          • IC: with all the hardware becomes small, the circuit board
          • The two different production lines into a production line
        • Technical updates: multi-channel technology

          1. Spatial multiplexing on: the memory sub-region, a memory can be loaded multiple processes

          2. multiplexed on time: the implementation will switch back and forth between multiple CPU processes, and reservation status

          Almost all programs have blocking IO,

          At the same time loaded into memory three tasks, three processes, each process has a blocking situation, as long as the cpu running a process, met immediately switch back to blocking IO, cpu will switch prolonged occupation.

          Improve efficiency, maximize the use of cpu.

          If an IO-intensive process, switch back and forth improve efficiency.

          If it is a computationally intensive, reducing the efficiency of the toggle.

          After the third generation of widely used computer hardware must be protected (program memory between isolated from each other), the third generation of computer applications and health:

          Each person occupies a limited computer time,

          People (less than 10) share a host computer,

          The fourth generation of computers: so far.

    3. Theory of the process:

      1. Serial: All tasks one by one to complete.

      2. Concurrency: a cpu to complete multiple tasks at the same time look like complete.

      3. Parallel: multiple cpu to perform multiple tasks, complete real time.

      4. Obstruction: cpu encountered IO is blocked.

      5. Non-blocking: there is no IO, called non-blocking

      6. Program: a bunch of static files

      7. A task program is being executed, a process.

      8. A program can open multiple processes? Can.

      9. Process of creation:

        A child must rely on a primary process before they can open.

        A master process can open multiple sub-processes.

        unix: fork to create a child process.

        unix (linux, mac): Creates a child process will completely copy all of the resources a primary process, initial resource unchanged.

        windows: the operating system call CreateProcess to create a treatment process.

        windows: create a child process will copy all the resources the main process, but will change some resources.

      10. State of the program:

Guess you like

Origin www.cnblogs.com/zhangdadayou/p/11431884.html