Parallel processing and virtual machines
แนะนำใหม่
14:50
RISC, Pipelines & Logic
นักออกแบบชิปสองคนเผชิญปัญหาเดียวกัน: ทำให้โปรแกรมทำงานเร็ว คนหนึ่งบอกว่า — สร้างคำสั่งทรงพลัง เพื่อให้แต่ละคำสั่งทำงานได้มาก คนอื่นบอกว่า — รักษา…
บรรยายภาษาอังกฤษ · สลับคำบรรยายภาษาอังกฤษและภาษาจีนได้
ในบทเรียนนี้
| English | ความหมาย |
|---|---|
| physical server | A real computer that provides services or resources to other computers. |
| application/ˌæplɪˈkeɪʃn/ | A program designed to perform a particular task for a user. |
| rack/ræk/ | A frame that holds computer equipment in an organised way. |
| virtual machines/ˈvɜːtʃuːəl məˈʃiːnz/ | 虚拟机 |
| physical hosts | Real computers that provide resources for virtual machines to run. |
| processor/ˈprəʊsesə/ | The component that executes instructions and performs the operations of a computer or similar system. |
| memory/ˈmeməri/ | The part of a computer that holds data and programs currently in use. |
| disks | Storage media that allow data to be read directly from known positions. |
| parallelism/ˈpærəlelɪzəm/ | การประมวลผลแบบขนาน |
| system architectures | Ways of organising a computer system and how its parts work together. |
| processing elements | Parts of a computer that carry out instructions and process data. |
| Flynn's taxonomy/flɪnz tækˈsɒnəmi/ | A way to group computer systems by how they handle instructions and data. |
| SIMD/ˈsɪmdiː/ | 单指令多数据 |
| instruction/ɪnˈstrʌkʃn/ | A command that tells the processor what action to perform. |
| MIMD/ˈmɪmdiː/ | 多指令多数据 |
| massively parallel/ˈmæsɪvli ˈpærəlel/ | 大规模并行 |
| distributed memory/ˈdɪstrɪbjuːtɪd ˈmeməri/ | หน่วยความจำแบบกระจาย |
| clock/klɒk/ | The number of timing cycles a processor makes each second. |
| execution environment | The resources and conditions a program needs to run. |
| system VM | A software-based virtual computer that runs a complete guest operating system. |
| process VM | A software-based environment that runs one program's portable code. |
| guest operating system/ɡest ˈɒpəreɪtɪŋ ˈsɪstəm/ | An operating system running inside a virtual machine rather than directly controlling the physical host hardware. |
| portable code | Code that can run on different platforms, such as bytecode run by a virtual machine. |
| emulator | Software or hardware that imitates another computer system so its programs can run. |
| isolation/ˌaɪsəˈleɪʃn/ | Keeping systems separate to limit how much actions in one can affect another. |
| portability | The ability of a program to run on different platforms. |
| hypervisor/ˌhaɪpəˈvaɪzə/ | ไฮเปอร์ไวเซอร์ |
| legacy system | An older computer system that is still used, often because it remains necessary. |
| server consolidation | Moving work from several servers onto fewer physical computers. |
| sandboxing/ˈsændbɒksɪŋ/ | การ Sandbox |
| language VM | A software environment that runs a program's portable code on a host computer. |
| bytecode/ˈbaɪtkəʊd/ | 字节码 |
| machine code/məˈʃiːn kəʊd/ | Instructions encoded in binary form that a processor can execute directly. |
| runtime safety | Protection provided by checking what a program does while it runs. |
| just-in-time compilation/dʒʌst ɪn taɪm ˌkɒmpɪˈleɪʃn/ | การคอมไพล์แบบทันที |
| hot code | Parts of a program that run often and can be compiled for faster execution. |
| native instructions | Commands that a computer's processor can execute directly. |
| hardware/ˈhɑːdweə/ | The physical parts of a computer system that can be touched. |
| network/ˈnetwɜːk/ | A set of connected devices or nodes that can exchange information. |
| platform/ˈplætfɔːm/ | The combination of processor and operating system on which a program runs. |
| shared resources | Computer resources used by more than one program or virtual machine. |
| single point of failure/ˈsɪŋɡl pɔɪnt ɒv ˈfeɪlɪə/ | One part whose failure can cause the whole system to stop working. |
คอมพิวเตอร์เครื่องเดียว pretending เป็นสี่สิบเครื่อง
- บริษัทเคยซื้อเซิร์ฟเวอร์กายภาพหนึ่งเครื่องต่อแอปพลิเคชัน: หนึ่งสำหรับอีเมล หนึ่งสำหรับเว็บไซต์ หนึ่งสำหรับบัญชี แต่ละเครื่องทำงานอยู่ที่ประมาณ 8% ของความสามารถ และแต่ละเครื่องใช้พลังงานเต็มในตู้ที่ต้องมีการระบายความร้อน
- Then the servers stopped being machines and became files. Forty virtual machines now run on three physical hosts, each one convinced it has a processor, memory and disks of its own.
- การประหยัดไม่ใช่แค่ไฟฟ้า Virtual machine สามารถ snapshot ก่อนการเปลี่ยนแปลงที่มีเสี่ยง, คัดลอกไปยัง host อื่นขณะ running, และ destroy ถ้าถูก compromised
- บทเรียนนี้คือ parallelism และ virtual machine: ความแตกต่างของสอง system architectures และ VM cost และ what it buys

Parallel architectures, briefly
- Parallelism means many processing elements working at once. Flynn's taxonomy names the shapes: SIMD runs one instruction over many data items, and MIMD runs different instructions on different data.
- A massively parallel machine takes MIMD ไปยัง thousands of processors, แต่ละมี its own distributed memory, สื่อสารด้วย messages
- Speed no longer comes from raising the clock, which is limited by heat, but from doing more things at once. Every architecture on this page is an answer to that.

Different instructions, different data, at the same time
SIMD means:
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Single Instruction, Multiple Data — e.g. a GPU running the same operation on thousands of pixels.
Match each of Flynn's categories to an example.
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Flynn classifies by how many instruction and data streams run at once: SISD, SIMD, MIMD (and the rare MISD).
A massively parallel computer uses:
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Massively parallel systems (supercomputers) link thousands of processors with distributed memory over a fast network.
What a virtual machine is
- Virtual machine คือ การจำลองคอมพิวเตอร์ทั้งเครื่องด้วยซอฟต์แวร์ ซอฟต์แวร์ที่รันอยู่ภายในเห็นโปรเซสเซอร์ เมมโมรี่ และดิสก์ที่ดูเป็นจริงแต่ถูกจัดเตรียมและจัดการโดยซอฟต์แวร์โฮสต์
- There are two kinds, and the exam distinguishes them: a system VM runs a complete guest operating system, and a process VM runs one program's portable code.
- Neither เป็น emulator of a faster machine Purpose ของ VM คือ isolation และ portability, ไม่ใช่ speed
ห้องปฏิบัติการแนวคิดการคำนวณ
Classify concrete examples by the computing idea they demonstrate.
What is a virtual machine?
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
The point is emulation and isolation, not speed. A system VM runs a whole guest OS; a process VM runs one program's bytecode.
System virtual machines
- A hypervisor คือ software ที่สร้างและ manage virtual machines, แบ่ง host's real processor, memory และ disks ระหว่าง them และ keep แต่ละตัว isolated จากกัน
- แต่ละ VM จะบูต ระบบปฏิบัติการบนเครื่อง ของมันเอง ดังนั้นโฮสต์เครื่องเดียวจึงสามารถรัน Windows, Linux และระบบเก่าแบบล่องหนไปพร้อมกันได้
- Uses: running different operating systems on one machine; server consolidation, replacing many under-used physical servers with one host; sandboxing, so risky or untrusted software runs isolated and cannot reach the host; and snapshots, so a machine can be rolled back to a known state.

A rack of hosts, each carrying many virtual machines
A hypervisor is used to:
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
A hypervisor manages system VMs, letting several guest operating systems share one physical machine.
A system VM (managed by a hypervisor) runs a whole guest operating system, whereas a process VM like the JVM just runs one program's portable bytecode.
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
System VMs share one physical machine among several guest OSes; process VMs give "write once, run anywhere" for a single program.
The software that creates and manages several system VMs on one host is called a ____.
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
It divides the host's real hardware between the guests and keeps each isolated, which is what makes sandboxing and consolidation possible.
Process virtual machines
- A process VM, also called a language VM, runs one program written in portable bytecode rather than the host's machine code. The Java Virtual Machine and the .NET CLR are the examples.
- Benefits: portability, since the same bytecode runs anywhere a VM exists, which is "write once, run anywhere"; runtime safety, since the VM checks what the code does; and just-in-time compilation of hot code to native instructions, so long-running programs approach native speed.
- Costs: an extra layer between the program และ hardware, และ VM must be installed before the program will run at all

Which are benefits of a process (language) VM such as the JVM? Select ทั้งหมด that apply.
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
The VM must be present; that is the cost of the portability. Portability, safety and JIT are the benefits.
Worked example: which kind of VM
- A security team wants to open suspicious email attachments without risking the company network. A system VM: the guest OS is isolated by the hypervisor, so malware cannot reach the host, and the snapshot is restored afterwards to discard anything it did.
- A developer wants one compiled program to run on Windows, macOS and Linux without recompiling. A process VM: the program is compiled to bytecode and each platform's VM runs it.
- Name the kind, then the property, isolation หรือ portability, that the situation needs
Put the consequences of one physical host failing, in order.
ความยาก 3/5 · 200 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Consolidation concentrates the risk: one host is a single point of failure for everything it carries. That is the limitation to state.
Worked example: benefits and limitations
- อธิบายข้อดีสองข้อและข้อจำกัดสองข้อของการใช้Virtual Machines มาแทนที่เซิร์ฟเวอร์ทางกายภาพของบริษัท [4]
- Benefits: several servers run on one physical host, so hardware, power and cooling costs fall; and each VM is isolated, so a compromised or crashed server does not affect the others, and can be restored from a snapshot.
- ข้อจำกัด: VMs แบ่งปัน โปรเซสเซอร์จริง หน่วยความจำ และดิสก์ของโฮสต์ ทำให้ประสิทธิภาพต่ำกว่าฮาร์ดแวร์เฉพาะเจาะจง และหาก VM หนึ่งทำงานหนักเกินไปอาจทำให้ VM อื่นขาดทรัพยากรได้; และหากโฮสต์ล้มเหลว ทุก VM บนนั้นจะล้มเหลวพร้อมกัน
- อย่างละสองข้อ โดยแต่ละข้อต้องเป็นผลกระทบ ไม่ใช่แค่อะไร่ฉลาก
คะแนนที่หลุดหายไป
- A hypervisor manages system VMs; It is not the guest operating system และ not the host's own OS
- A process VM runs bytecode, which is not machine code. That is what makes it portable.
- The limitation of a VM is shared resources and a single point of failure, not "it is complicated"
- "Sandboxing" needs its consequence: the risky software is isolated from the host, so it cannot damage or reach it
คุณเข้าใจแล้ว
- parallelism ตอบคำถามเรื่องขีดจำกัดความเร็วนาฬิกา: SIMD สำหรับคำสั่งเดียวบนข้อมูลหลายชุด, MIMD สำหรับคำสั่งหลายชุด, และ massively parallel สำหรับโปรเซสเซอร์นับพันพร้อมหน่วยความจำแบบกระจาย
- virtual machine คือการจำลองคอมพิวเตอร์ทั้งเครื่องด้วยซอฟต์แวร์
- system VM ทำงานระบบปฏิบัติการผู้รับ (guest OS) แบบเต็มรูปแบบภายใต้ hypervisor: ระบบปฏิบัติการต่างกันบนเครื่องเดียว, การรวมเซิร์ฟเวอร์, sandboxing, และการสร้างสแนปช็อต
- process VM ทำงาน bytecode ที่พกพาได้พร้อมความปลอดภัยขณะรันและ just-in-time compilation; ค่าใช้จ่ายคือชั้นเพิ่มเติม, การใช้ทรัพยากรโฮสต์ร่วมกัน และหากโฮสต์ล้มเหลวจะทำให้ทุก VM ล้มตามไปด้วย
เกิดปัญหาอะไรขึ้น? เฉพาะทีมเว็บไซต์เท่านั้นที่เห็นข้อมูลนี้