写译 — 引入线程的优势? 线程的实现方式?

70 阅读4分钟
  • Author : Cyan_RA9
  • 和大家分享英语写译,包括计算机英文教材,计算机基础,中英文诗词,英文名著,日常对话等,每一篇文章 我都会分别给出“原文内容”,“第一版翻译” 和 “第二版翻译”,以及“生词整理”共四部分。
  • 写译 — “引入线程的优势? 线程的实现方式?

【原文内容】

  • 引入线程的优势:
    1. 进一步提高并发性:在单处理机系统中,线程模型可以分离同一个进程内的CPU计算和I/O访问,让它们并发执行;在多处理机系统中,引入线程模型后,每个内核级线程都能占用一个处理机,这使得多处理机系统的优势得以发挥。
    2. 共享地址空间与可用数据:线程之间可以直接共享数据而不需要经由操作系统内核,在速度上有很大优势。
    3. 更轻量级:在很多操作系统中,一个线程的创建比一个进程的创建快10~100倍。(线程的切换和撤销也远快于进程)
    4. 更好的交互性:线程可以提高图形界面程序的交互性,避免程序“卡死”,使用户得到更好的体验。
  • 线程的实现方式主要分为两类——内核级线程(Kernel Supported Threads,KST)和用户级线程(User-Level Threads,ULT)。
    1. 用户级线程:线程的管理由应用程序实现,在用户空间下完成,操作系统感知不到线程的存在。在这种实现方式下,系统调度的最小单位依然是进程,线程的调度则由其所在进程实现。
    2. 内核级线程:需要操作系统内核的支持,其创建、阻塞、撤销和切换都是在内核空间下实现的,内核通过TCB(线程控制块)来对线程进行感知和控制。在这种实现方式下,线程是系统调度的最小单位

【第一版翻译:(润色前,手译)】

  • Advantages after the introduction of Threads:
    1. FURTHER ENHANCING CONCURRENCY:In Uniprocessor System, thread model can separate CPU calculation and I/O access in the same process, making them execute concurrently; In Multiprocessor System, every single KLT could occupy a processor after the introduction of Thread-Model, making the advantages of multiprocessor system go into effect.
    2. SHARING THE ADDRESS SPACE AND AVAILABLE DATA:Threads can directly share data from each other without via the kernel of Operating System, making it much prevailing in terms of speed.
    3. MORE LIGHTWEIGHT:In many operating systems, creating a thread is 10 to 100 times faster than creating a process.(Threads' shifting and cancelling are also much faster than processes')
    4. BETTER INTERACTION:Threads can enhance the interaction experience of program in Graphic interfaces, prevent the program from freezing and make users get better experience.
  • Thread implementations are primarily categorized into two types---Kernel-Level Threads(KLT) and User-Level Threads(ULT).
    1. User-Level Threads:Thread management is handled by the application in user space, and the operating system is unaware of the threads' existence.. In this implementation, the smallest unit of system scheduling remains the process, while thread scheduling is managed by the process itself.
    2. Kernel-Level Threads:These require support from the Operating System Kernel. Their creation, blocking, termination, and switching are performed in kernel space. The kernel perceives and controls threads through TCBs(Thread Control Blocks), the thread is the smallest unit of system scheduling.

【第二版翻译:(润色后,雅思水准)】

  • Advantages after the introduction of Threads:
    1. FURTHER ENHANCING CONCURRENCY:In a Uniprocessor System, thread model can separate CPU computation and I/O access in the same process, enabling them to execute concurrently; In a Multiprocessor System, every single KLT could occupy a processor after the introduction of Thread-Model, fully utilizing the advantages of multiprocessor systems.
    2. SHARING THE ADDRESS SPACE AND AVAILABLE DATA:Threads can directly share data from each other without going through the kernel of Operating System, making it significantly faster.
    3. MORE LIGHTWEIGHT:In many operating systems, creating a thread is 10 to 100 times faster than creating a process.(Additionally, thread switching and termination are also much faster than those of processes.)
    4. BETTER INTERACTION:Threads can enhance the user interaction experience in Graphic interfaces, prevent the program from freezing and provide users with a better experience.
  • Thread implementations are primarily categorized into two types---Kernel-Level Threads(KLT) and User-Level Threads(ULT).
    1. User-Level Threads:Thread management is handled by the application in user space, and the operating system remains unaware of the threads' existence.. In this implementation, the process remains the smallest unit of system scheduling, while thread scheduling is managed by the process itself.
    2. Kernel-Level Threads:These require support from the Operating System Kernel. Their creation, blocking, termination, and switching are performed in kernel space. The kernel perceives and controls threads through TCBs(Thread Control Blocks), the thread is the smallest unit of system scheduling.

【生词整理】

  • Uniprocessor System: 单处理机系统
  • Multiprocessor System:多处理机系统
  • go through: 经由
  • MORE LIGHTWEIGHT:更轻量级
  • thread switching and termination:线程切换和撤销
  • Graphic Interfaces:图形界面
  • freezing:卡死
  • implementation:实现方式
  • the smallest unit of: ...的最小单位