
TCSS 422 A – Spring 2020 4/7/2020 School of Engineering and Technology TCSS 422: OPERATING SYSTEMS OBJECTIVES – 4/7 Questions from 4/2 Chapter 4: Processes INTRODUCTION TO . Kernel data structures for processes and threads OPERATING SYSTEMS, Chapter 5: Process API PROCESSES . fork(), wait(), exec() Assignment 0 Chapter 6: Limited Direct Execution Wes J. Lloyd . Direct execution School of Engineering and Technology . Limited direct execution University of Washington - Tacoma . CPU modes . System calls and traps . Cooperative multi-tasking . Context switching and preemptive multi-tasking TCSS422: Operating Systems [Spring 2020] TCSS422: Operating Systems [Spring 2020] April 7, 2020 April 7, 2020 L3.2 School of Engineering and Technology, University of Washington - Tacoma School of Engineering and Technology, University of Washington - Tacoma 1 2 MATERIAL / PACE FEEDBACK FROM 4/2 Please classify your perspective on material covered in On Chapter 2: today’s class (60 respondents): “I feel like I got lost at points but I can't drill down 1-mostly review, 5-equal new/review, 10-mostly new exactly what the issue was or what I was missing to fully understand what you were showing us. I just recall you Average – 7.03 ( from 5.83) saying this was an intro instead of a deep dive into the material” Please rate the pace of today’s class: YES! Chapter 2 provides a broad survey of the “three easy 1-slow, 5-just right, 10-fast pieces” all in one lecture. We will revisit everything in Average – 5.76 ( from 5.17) more detail as we go along… I also introduced “context switches” ahead of time with the mem.c example. We’ll go over this again today in Ch. 6 TCSS422: Operating Systems [Spring 2020] TCSS422: Operating Systems [Spring 2020] April 7, 2020 L3.3 April 7, 2020 L3.4 School of Engineering and Technology, University of Washington - Tacoma School of Engineering and Technology, University of Washington - Tacoma 3 4 FEEDBACK - 2 FEEDBACK - 3 Processes have their own address space (i.e. memory), The overall process of concurrency is still a bit unclear to me. threads do not. A process crashing won't affect another process. Concurrency simply means doing multiple things at the same time on a computer. i.e. Chrome tabs are processes, and a crashed tab does not crash the entire browser Today’s computer have multiple processing ** Are there any other differences between threads and cores processes? (i.e. CPU cores) Linux threads have a smaller data structure than processes Each core can perform a different independent Threads are owned by processes task “concurrently” Creating a new thread is faster than creating a new process at the same time Threads share memory, and can communicate through RAM Check how many CPU Inter-process communication involves opening a file or cores in Ubuntu with network stream (pipe) between processes “lscpu” (covered in TCSS 430) TCSS422: Operating Systems [Spring 2020] TCSS422: Operating Systems [Spring 2020] April 7, 2020 L3.5 April 7, 2020 L3.6 School of Engineering and Technology, University of Washington - Tacoma School of Engineering and Technology, University of Washington - Tacoma 5 6 Slides by Wes J. Lloyd L3.1 TCSS 422 A – Spring 2020 4/7/2020 School of Engineering and Technology FEEDBACK - 4 FEEDBACK - 5 Why is it best for the CPU to perform a context Another student suggested that a single program switch when a thread is blocked? that didn't have any concurrency would be able to run without an OS, however I am having trouble Deschedule Which states is the Running d Ready imagining a computer without an OS. process (job) idle? Scheduled In a sense, sort of, yes What are the I/O: initiate I/O: done We talk about DIRECT EXECUTION today as part of consequences of suspending an Chapter 6, which is a bit like a computer without idle process? Blocked an OS. a running process? TCSS422: Operating Systems [Spring 2020] TCSS422: Operating Systems [Spring 2020] April 7, 2020 L3.7 April 7, 2020 L3.8 School of Engineering and Technology, University of Washington - Tacoma School of Engineering and Technology, University of Washington - Tacoma 7 8 MOTIVATION FOR LINUX MOTIVATION FOR LINUX - 2 It is worth noting the importance of Linux for today’s Consider an example where you’re asked to develop a web developers and computer scientists. services backend that requires 10 x 8-CPU-core virtual servers The CLOUD runs many virtual machines, recently in 2019 a key Your organization investigates hosting costs on Amazon cloud milestone was reached. 8-core VM is “c5d.2xlarge” Even on Microsoft Azure (the Microsoft Cloud), there were more Linux Virtual Machines (> 50%) than Windows. https://www.zdnet.com/article/microsoft-developer-reveals- linux-is-now-more-used-on-azure-than-windows-server/ https://www.zdnet.com/article/it-runs-on-the-cloud-and-the- cloud-runs-on-linux-any-questions/ The majority of application back-ends (server-side), cloud or Windows hourly price 75.2 not, run on Linux. Linux hourly price 38.4 This is due to licensing costs, example: See: https://www.ec2instances.info/ TCSS422: Operating Systems [Spring 2020] TCSS422: Operating Systems [Spring 2020] April 7, 2020 L3.9 April 7, 2020 L3.10 School of Engineering and Technology, University of Washington - Tacoma School of Engineering and Technology, University of Washington - Tacoma 9 10 “QUIZ” 0 – C PROGRAMMING MOTIVATION FOR LINUX - 2 BACKGROUND SURVEY Consider an example where you’re asked to develop a web Available via Canvas System servicesOne year backend cloud that hosting requires cost:10 x 8-CPU-core virtual servers Your organization investigates hosting costs on Amazon cloud 8-coreWINDOWS VM is “c5d.2xlarge” Under: 10 VMs x 8,760 hours x $.752 = $65,875.20 Assignments Tutorials/Quizzes/In-class Activities Linux Please disregard grade assigned by Canvas 10 VMs x 8,760 hours x $.384 = $33,638.40 All submissions will receive 10 pts after assignment WindowsWindows hourly comes price 75.2 at a 95.8% price premium Linux hourly price 38.4 closes - (closes Thursday 4/9 @ 11:59p) See: https://www.ec2instances.info/ TCSS422: Operating Systems [Spring 2020] TCSS422: Operating Systems [Spring 2020] April 7, 2020 L3.11 April 7, 2020 L3.12 School of Engineering and Technology, University of Washington - Tacoma School of Engineering and Technology, University of Washington - Tacoma 11 12 Slides by Wes J. Lloyd L3.2 TCSS 422 A – Spring 2020 4/7/2020 School of Engineering and Technology VIRTUAL MACHINE SURVEY OBJECTIVES – 4/7 Virtual Machine Survey Questions from 4/2 Chapter 4: Processes Request for Ubuntu 18.04 VMs has been sent to . Kernel data structures for processes and threads the School of Engineering and Technology LABS Chapter 5: Process API Expect response soon regarding connection . fork(), wait(), exec() information Assignment 0 Chapter 6: Limited Direct Execution . Direct execution Thank you! . Limited direct execution . CPU modes . System calls and traps . Cooperative multi-tasking . Context switching and preemptive multi-tasking TCSS422: Operating Systems [Spring 2020] TCSS422: Operating Systems [Spring 2020] April 7, 2020 L3.13 April 7, 2020 L3.14 School of Engineering and Technology, University of Washington - Tacoma School of Engineering and Technology, University of Washington - Tacoma 13 14 PROCESS DATA STRUCTURES OS provides data structures to track process information . Process list . Process Data . State of process: Ready, Blocked, Running CHAPTER 4: . Register context PROCESSES PCB (Process Control Block) . A C-structure that contains information about each process TCSS422: Operating Systems [Spring 2020] TCSS422: Operating Systems [Spring 2020] April 7, 2020 April 7, 2020 L3.16 School of Engineering and Technology, University of Washington - Tacoma L3.15 School of Engineering and Technology, University of Washington - Tacoma 15 16 XV6 KERNEL DATA STRUCTURES XV6 KERNEL DATA STRUCTURES - 2 xv6: pedagogical implementation of Linux // the information xv6 tracks about each process Simplified structures // including its register context and state struct proc { // the registers xv6 will save and restore char *mem; // Start of process memory // to stop and subsequently restart a process uint sz; // Size of process memory struct context { char *kstack; // Bottom of kernel stack int eip; // Index pointer register // for this process int esp; // Stack pointer register enum proc_state state; // Process state int ebx; // Called the base register int pid; // Process ID int ecx; // Called the counter register struct proc *parent; // Parent process int edx; // Called the data register void *chan; // If non-zero, sleeping on chan int esi; // Source index register int killed; // If non-zero, have been killed int edi; // Destination index register struct file *ofile[NOFILE]; // Open files int ebp; // Stack base pointer register struct inode *cwd; // Current directory }; struct context context; // Switch here to run process struct trapframe *tf; // Trap frame for the // the different states a process can be in // current interrupt enum proc_state { UNUSED, EMBRYO, SLEEPING, }; RUNNABLE, RUNNING, ZOMBIE }; TCSS422: Operating Systems [Spring 2020] TCSS422: Operating Systems [Spring 2020] April 7, 2020 L3.17 April 7, 2020 L3.18 School of Engineering and Technology, University of Washington - Tacoma School of Engineering and Technology, University of Washington - Tacoma 17 18 Slides by Wes J. Lloyd L3.3 TCSS 422 A – Spring 2020 4/7/2020 School of Engineering and Technology LINUX: STRUCTURES
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages13 Page
-
File Size-