Lecture 2: Kernels and Processes
|
|
- Jonah Perkins
- 6 years ago
- Views:
Transcription
1 Lecture 2: Kerels ad Processes CS170 Sprig UCSB Yag Some of slides are from Chapter 2 of the AD textbook. OSC book. J. Kubiatowicz CS162@UCB
2 What to lear Process Cocept Cotext Switch &Process Schedulig Operatios o Processes Iterprocess Commuicatio
3 Four fudametal OS cocepts Thread Sigle uique executio cotext Program Couter, Registers, Executio Flags, Stack Address Space w/ Traslatio Programs execute i a address space that is distict from the memory space of the physical machie Process A istace of a executig program is a process cosistig of a address space ad oe or more threads of cotrol Dual Mode operatio/protectio Oly the system has the ability to access certai resources The OS ad the hardware are protected from user programs ad user programs are isolated from oe aother by cotrollig the traslatio from program virtual addresses to machie physical addresses
4 Process Cocept Textbook uses the terms job ad process almost iterchageably process memory Process a program i executio; progress i sequetial fashio A process i memory icludes: program couter Stack/heap Data/istructio (text) sectio Need memory protectio ad address traslatio
5 OS Bottom Lie: Ru Programs Program Source Executable Memory istructios 0x000 it mai() { ; } editor compiler istructios data Load & Execute data heap foo.c a.out stack Load istructio ad data segmets of executable file ito memory Create stack ad heap PC: OS 0xFFF Trasfer cotrol to it registers Provide services to it Processor
6 Load a Executable File to Process Header magic umber idicates type of image. Sectio table: a array of (offset, le, startva) Program/data sectios Used by liker; may be removed after fial lik step header text idata wdata symbol table relocatio records program istructios p immutable data (costats) hello\ writable global/static data j, s j, s,p,sbuf it j = 327; char* s = hello\ ; char sbuf[512]; it p() { it k = 0; j = write(1, s, 6); retur(j); }
7 Dual Mode Operatio Hardware provides at least two modes: Kerel mode (or supervisor or protected ) User mode: Normal programs executed What is eeded i the hardware to support dual mode operatio? a bit of state (user/system mode bit) Certai operatios / actios oly permitted i system/kerel mode I user mode they fail or trap User->Kerel trasitio sets system mode AND saves the user PC Operatig system code carefully puts aside user state the performs the ecessary operatios Kerel->User trasitio clears system mode AND restores appropriate user PC retur-from-iterrupt
8 For example: UNIX System Structure User Mode Applicatios Stadard Libs Kerel Mode Hardware
9 User/Keral(Priviledged) Mode syscall User Mode iterrupt exceptio exec Kerel Mode exit Limited HW access Full HW access
10 Simple Memory Protectio i Process code 0000 code 0000 Static Data Static Data heap heap stack Base register stack Program address 1000 >= Boud register < code Static Data heap stack 1100 Memory protectio with two registers Need proper address settig durig program loadig FFFF
11 Aother idea: Address Space Traslatio Program operates i a address space that is distict from the physical memory space of the machie 0x000 Processor traslator Memory 0xFFF
12 A simple address traslatio with Base ad Boud code 0000 code 0000 Static Data heap Static Data heap stack Base Address stack 1000 code 1000 Program address Static Data heap Boud < 0100 stack 1100 Ca the program touch OS? Ca it touch other programs? FFFF
13 Process State As a process executes, it chages state ew: The process is beig created ruig: Istructios are beig executed waitig: The process is waitig for some evet to occur ready: The process is waitig to be assiged to a processor termiated: The process has fiished executio
14 Diagram of Process State
15 Process Cotrol Block (PCB) Iformatio associated with each process Process state Program couter Copy of CPU registers CPU schedulig iformatio Memory-maagemet iformatio Page table Accoutig iformatio I/O status iformatio
16 Cotext Switch Whe CPU switches to aother process with a ew address space, the system must save the state of the old process ad load the saved state for the ew process via a cotext switch. Cotext of a process represeted i the PCB Cotext-switch time is overhead; the system does o useful work while switchig
17 CPU Switch From Process to Process
18 Tyig it together: OS loads process Proc 1 Proc 2 OS Proc code Static Data heap 0000 sysmode Base 1 xxxx 0000 stack code Static Data 1000 Boud xxxx FFFF heap upc PC regs xxxx stack code Static Data heap stack 3080 FFFF
19 Proc 1 Simple B&B: OS gets ready to switch Proc 2 OS Proc code Static Data heap 0000 sysmode Base stack code Static Data 1000 Boud 1100 FFFF heap Retur poit upc PC regs FF stack code Static Data heap stack 3080 FFFF
20 Process Schedulig Queues Job queue set of all processes i the system Ready queue set of all processes residig i mai memory, ready ad waitig to execute Device queues set of processes waitig for a I/O device Processes migrate amog the various queues
21 Ready Queue Ad Various I/O Device Queues
22 Represetatio of Process Schedulig
23 Schedulers Log-term scheduler Selects which processes should be brought ito the ready queue ivoked very ifrequetly (secods, miutes) cotrols the degree of multiprogrammig Short-term scheduler selects which process should be executed ext ad allocates CPU is ivoked very frequetly (millisecods) Þ (must be fast)
24 Process Creatio Paret process create childre processes. process idetified via a process idetifier (pid) Optios i resource sharig Paret ad childre share all resources Childre share subset of paret s resources Paret ad child share o resources Executio Paret ad childre execute cocurretly Paret waits util childre termiate
25 Process Creatio (Cot.) Optios i address space Child duplicate of paret Child has aother program loaded UNIX examples fork system call creates ew process with duplicated address space With a copy of same code ad data. exec system call used after a fork to replace the process memory space with a ew program
26 Uix Fork/Exec/Exit/Wait Example it pid = fork(); Create a ew process that is a cloe of its paret. Fork() > 0 as paret Fork() ==0 child exec*( program [, argvp, evp]); Overlay the callig process virtual memory with a ew program, ad trasfer cotrol to it. iitialize child cotext exec exit(status); Exit with status, destroyig the process. it pid = wait*(&status); Wait for exit (or other status chage) of a child. wait exit
27 Example: Process Creatio i Uix The fork syscall returs twice: it returs a zero to the child ad the child process ID (pid) to the paret. it pid; it status = 0; if (pid = fork()) { /* paret */.. pid = wait(&status); } else { /* child */.. exit(status); } Paret uses wait to sleep util the child exits; wait returs child pid ad status. Wait variats allow wait o a specific child, or otificatio of stops ad other sigals.
28 C Program Forkig Separate Process it mai() { it pid; pid = fork(); /* fork aother process */ if (pid < 0) { /* error occurred */ fpritf(stderr, "Fork Failed"); exit(-1); } else if (pid == 0) { /* child process */ execlp("/bi/ls", "ls", NULL); } else { /* paret process */ wait (NULL); /*paret waits for the child */ exit(0); } }
29 C Program Forkig Separate Process it mai() { it pid, hello=1; pid = fork(); /* fork aother process */ if (pid < 0) { /* error occurred */ fpritf(stderr, "Fork Failed"); exit(-1); } else if (pid == 0) { /* child process */ hello=0; execlp("/bi/ls", "ls", NULL); prit( Child hello =%d, hello); } } else { /* paret process */ } What is prited i child? 0, 1, or othig What is prited i paret? 0, 1, or othig wait (NULL); /*paret waits for the child*/ pritf( hello= %d, hello); exit(0);
30 Uix Fork/Exec/Exit/Wait Example hello=1 Pid>0 it mai() { as paret with it pid, hello=1; old address space pid = fork(); if (pid == 0) { /* child */ hello=0; execlp("/bi/ls", "ls", NULL); pritf( hello=%d, hello); } else { /* paret process */ wait (NULL); pritf( hello=%d, hello); wait exit(0); } } fork() hello==1 Pid==0 child with duplicated address space iitialize child hello=0 cotext exec() reloads address space Old child code is wiped out exit
31 C Program Forkig Separate Process it mai() { it pid, hello=1; pid = fork(); /* fork aother process */ if (pid < 0) { /* error occurred */ fpritf(stderr, "Fork Failed"); exit(-1); } else if (pid == 0) { /* child process */ hello=0; execlp("/bi/ls", "ls", NULL); prit( Child hello =%d, hello); } } else { /* paret process */ } What if execlp() fails? Child prits 0 What is prited i paret? 1 wait (NULL); /*paret waits for the child*/ pritf( hello= %d, hello); exit(0); What is prited i child? othig
32 Shell A shell is a job cotrol system Lets user execute system utilities/applicatios Widows, MacOS, Liux all have shells Typical format: cmd arg1 arg2... arg i/o redirectio <, > filters & pipes ls more Proj 0
33 Summary o Fork() Create a child PCB with ew id Allocate memory for the child ad duplicate everythig from paret Icludig text/heap/stack. But otice child space is a copy of paret space. All file descriptors that are ope i the paret are duplicated i the child. File read()/write() set offsets are shared May evirometal setigs ad shared segemets are iherited by child. Paret/child ca commuicate through shared segemets Add the child process to ready queue Paret memory pages Paret PCB Child memory pages Child PCB
34 I/O Redirectio with dupe2() File descriptor for stadard iput/output/error at Uix 0 stdi stdout, 2 --stderr dup2(it f_orig, it f_ew) duplicate file descriptor Implemet shell commad ls > temp : fd = ope( temp, O_CREAT O_TRUNC O_WRONLY, 0644)) dup2(fd,1) /*Use temp file as the stadard output*/ ls temp pritf( hello\ ) execvp( ls, )
35 Liux Commad: ps Show your processes or others
36 Liux commad: Pstree -A Show Liux processes i a tree structure
37 Liux commad: Top Top - Show all active processes i details
38 Process Termiatio Process executes last statemet ad asks the operatig system to delete it (exit) Output data from child to paret (via wait) Process resources are deallocated Paret may termiate childre processes Task assiged to child is o loger required If paret is exitig
39 Iterprocess Commuicatio Processes withi a system may idepedet or cooperatig with iformatio sharig Cooperatig processes eed iterprocess commuicatio (IPC) Shared memory Message passig
40 Commuicatios Models
41 Iterprocess Commuicatio with Message Passig Direct messages: Processes must ame each other explicitly: sed (P, message) sed a message to process P receive(q, message) receive a message from process Q Idirect messages: Messages are directed ad received from mailboxes (also referred to as ports) Each mailbox has a uique id Processes ca commuicate oly if they share a mailbox
42 Popular Mechaisms for Process Commuicatio Uix sigals Uix Pipe Shared memory IPC i Posix POSIX is the ame of a family of related stadard specified by IEEE to defie API i Uix. Sockets Remote Procedure Calls (RPC)
43 Uix Sigals Proc 1 Proc 2 sigal A evet similar to hardware iterrupt without priorities Usage: iform a user process of a evet For example, user pressed delete key Each sigal is represeted by a umeric value. Examples: 02, SIGINT: iterrupt a process from a termial (Ctrl-C) 09, SIGKILL: termiate a process SIGUSR1, SIGUSR2: user defied. sigal.h defies the sigals A UNIX sigal raised by a process usig a systems call: kill(sigusr1, process_id) a shell commad: kill -s USR1 process_id
44 UNIX Sigals Each sigal is maitaied as a sigle bit i the process table etry of the receivig process the bit is set whe the correspodig sigal arrives (o waitig queues) A sigal is processed as soo as the process eters i user mode 3 ways to hadle a sigal Igore it: sigal(sig#, SIG_IGN) Ru the default hadler: sigal(sig#, SIG_DFL) Ru a user-defied hadler: sigal(sig#, myhadler) Proc 2 Proc 1 sigal
45 Sigal Hadlig /* code for process p */... sigal(sig#, sig_hdlr);... /* ARBITRARY CODE */ void sig_hdlr(...){ /* hadler code */ } Process p SIG# is raised for p sig_hdlr rus i p s address space p resumes executio
46 Example of sigal program #iclude <sigal.h> mai() { void ct(it sig); sigal(sigint, ct); // Cotrol-C pritf("begi coutig ad INTERRUPTs\"); for(;;); /* ifiite loop */ How may times do you have } to push ctrl-c before exit? void ct(it sig) { static it cout=0; pritf("total of %d INTERRUPTS received\", ++cout); }
47 Example of sigal program #iclude <sigal.h> mai() { void ct(it sig); sigal(sigint, ct); // Cotrol-C pritf("begi coutig ad INTERRUPTs\"); for(;;); /* ifiite loop */ } void ct(it sig) { static it cout=0; } How may times do you have to push ctrl-c before exit? NEVER EXIT pritf("total of %d INTERRUPTS received\", ++cout);
48 Example of sigal program Default way (SIG_DFL) to respod with exit() #iclude <sigal.h> mai() { void ct(it sig); sigal(sigint, ct); // Cotrol-C pritf("begi coutig ad INTERRUPTs\"); for(;;); /* ifiite loop */ } void ct(it sig) { static it cout=0; pritf("total of %d INTERRUPTS received\", ++cout); How may times do you have if(cout==1) to push ctrl-c before exit?1, 2, 3 sigal(sigint, SIG_DFL);
49 Example of sigal program #iclude <sigal.h> mai() { void ct(it sig); sigal(sigint, ct); // Cotrol-C pritf("begi coutig ad INTERRUPTs\"); for(;;); /* ifiite loop */ } void ct(it sig) { static it cout=0; pritf("total of %d INTERRUPTS received\", } ++cout); if(cout==1) How may times do you have to push ctrl-c before exit? 2 sigal(sigint, SIG_DFL); // default hadlig for that sigal will occur.
50 UNIX Pipes for Process Commuicatio The process commuicatio through a file-like iterface pipe(fd) creates the pipe ad kerel allocates a buffer with two poiters fd[0] ad fd[1] File read / write calls are used to sed/receive iformatio o the pipe. Processes use fd[1] to write ad fd[0] to read pipe hadles (fd[0] & fd[1]) are copied to the child durig fork() Usage applicatio ls wc Proc 1 pipe fd Proc 2 ls wc it fd[2];... pipe(fd);... Paret Child Write if(fork() == 0) { /* the child */... read(fd[0], ibuf, size);... } else { /* the paret */... write(fd[1], hello, size);... }
51 UNIX Pipes Paret process, P it fd[2]; pipe(fd); fork() write(fd[1], hello, size); Child process, Q /* gets a copy of paret s variables icludig the pipe poiters fd[0] ad fd[1] */ read(fd[0], ibuf, size); pipe for P ad Q write fuctio Folleh FIFO buffer Liux capacity: default 64KB read fuctio
52 I/O pipelie betwee two commads usig pipe() ad dupe2() Shell commad: ls wc Process 1: dup2(fd[1],1) /* use pipe as stdout */ close(fd[0]) execvp( ls, ); Process 2: dup2(fd[0], 0) /*Use pipe as stdi */ close(fd[1]) execvp( wc, ) Who executes pipe(fd)? Who creates Process 1 or process 2? Proc 1 pipe fd Proc 2 ls wc /*close uused part*/
53 I/O pipelie betwee two commads usig pipe() ad dupe2() Shell commad: ls wc pipe(fd) Child Process 1: dup2(fd[1],1) /* use pipe as stdout */ close(fd[0]) execvp( ls, ); Child Process 2: dup2(fd[0], 0) /*Use pipe as stdi */ close(fd[1]) execvp( wc, ) Paret calls pipe(fd) ad creates Processs 1&2 Proc 1 pipe fd Proc 2 ls wc /*close uused part*/ paret s/c-tutorials/pipe.html
54 Process Commuicatio through Shared Memory POSIX shared memory stadard Write process Create shared memory segmet segmet id = shmget(key, size, IPC_CREAT); Attach shared memory to its address space addr= (char *) shmat(id, NULL, flag); write to the shared memory *addr = 1; Detech shared memory shmdt(addr); Read process segmet id = shmget(key, size, 0666); addr= (char *) shmat(id, NULL, 0); c= *addr; shmdt(addr);
55 = read(rfd,rbuf,rmax); File I/O as Commuicatio betwee processes Commuicatio betwee processes: view files as commuicatio chaels (streams) write(wfd, wbuf, wle); = read(rfd,rbuf,rmax); Commuicatio across the world write(wfd, wbuf, wle);
56 Request Respose Protocol i Cliet- Server Commuicatio Cliet (issues requests) write(rqfd, rqbuf, bufle); requests Server (performs operatios) = read(rfd,rbuf,rmax); wait service request write(wfd, respbuf, le); resposes = read(resfd,resbuf,resmax);
57 Sockets i Cliet-server systems A socket: Cocateatio of IP address ad port The socket :80 refers to port 80 o host
58 try { Example: Cliet coectio i Java Make a coectio to server Socket sock = ew Socket(" ",80); IputStream i = sock.getiputstream(); Read data set from serve ad prit BufferedReader bi = ew BufferedReader(ew IputStreamReader(i)); Strig lie; while( (lie = bi.readlie())!= ull) System.out.pritl(lie); } sock.close();
59 Server code: hadlig cliet requests oe by oe ServerSocket sock = ew ServerSocket(80); while (true) { Socket cliet = sock.accept(); // we have a coectio Create a socket to liste Liste for coectios Write date to the socket true); PritWriter pout = ew PritWriter(cliet.getOutputStream(), pout.pritl(ew java.util.date().tostrig()); } cliet.close(); Close the socket ad resume listeig for more coectios
60 Key OS Cocepts so far Processes Memory Protectio, Address Space, Dual Mode States of processes PCB (Process cotrol block) Cotext Switch &Process Schedulig System calls o processes fork, wait, exec, dup2 Process commuicatio UNIX sigals, pipes, shared memory, socket.
Lecture 14. Shell. File descriptors. File table and descriptors. Fork and exec Fd manipulation Pipes
218 Dr. Jeffrey A. Turkstra 1 Lecture 14 File table ad descriptors CS 252: Systems Programmig Lecture 14: Files, Fork, ad Pipes Fork ad exec Fd maipulatio Pipes Dr. Jef Turkstra 218 Dr. Jeffrey A. Turkstra
More informationChapter 4 Threads. Operating Systems: Internals and Design Principles. Ninth Edition By William Stallings
Operatig Systems: Iterals ad Desig Priciples Chapter 4 Threads Nith Editio By William Stalligs Processes ad Threads Resource Owership Process icludes a virtual address space to hold the process image The
More informationRecall: What is an operating system? Very Brief History of OS. Very Brief History of OS. CS162 Operating Systems and Systems Programming Lecture 2
Recall: What is a operatig system? CS6 Operatig Systems ad Systems Programmig Lecture Itroductio to esses Special layer of software that provides applicatio software access to hardware resources Coveiet
More informationChapter 2: Processes & Threads. Chapter 2
: Processes & Threads Processes ad threads Processes Threads Schedulig Iterprocess commuicatio Classical IPC problems (origialy modified by Etha 2 What is a process? Code, data, ad stack Usually (but ot
More informationCMSC Computer Architecture Lecture 12: Virtual Memory. Prof. Yanjing Li University of Chicago
CMSC 22200 Computer Architecture Lecture 12: Virtual Memory Prof. Yajig Li Uiversity of Chicago A System with Physical Memory Oly Examples: most Cray machies early PCs Memory early all embedded systems
More informationOutline. CSCI 4730 Operating Systems. Questions. What is an Operating System? Computer System Layers. Computer System Layers
Outlie CSCI 4730 s! What is a s?!! System Compoet Architecture s Overview Questios What is a?! What are the major operatig system compoets?! What are basic computer system orgaizatios?! How do you commuicate
More informationThreads and Concurrency in Java: Part 1
Cocurrecy Threads ad Cocurrecy i Java: Part 1 What every computer egieer eeds to kow about cocurrecy: Cocurrecy is to utraied programmers as matches are to small childre. It is all too easy to get bured.
More informationThreads and Concurrency in Java: Part 1
Threads ad Cocurrecy i Java: Part 1 1 Cocurrecy What every computer egieer eeds to kow about cocurrecy: Cocurrecy is to utraied programmers as matches are to small childre. It is all too easy to get bured.
More informationReliable Transmission. Spring 2018 CS 438 Staff - University of Illinois 1
Reliable Trasmissio Sprig 2018 CS 438 Staff - Uiversity of Illiois 1 Reliable Trasmissio Hello! My computer s ame is Alice. Alice Bob Hello! Alice. Sprig 2018 CS 438 Staff - Uiversity of Illiois 2 Reliable
More informationMorgan Kaufmann Publishers 26 February, COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. Chapter 5.
Morga Kaufma Publishers 26 February, 208 COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Iterface 5 th Editio Chapter 5 Virtual Memory Review: The Memory Hierarchy Take advatage of the priciple
More informationUsing the Keyboard. Using the Wireless Keyboard. > Using the Keyboard
1 A wireless keyboard is supplied with your computer. The wireless keyboard uses a stadard key arragemet with additioal keys that perform specific fuctios. Usig the Wireless Keyboard Two AA alkalie batteries
More informationPython Programming: An Introduction to Computer Science
Pytho Programmig: A Itroductio to Computer Sciece Chapter 6 Defiig Fuctios Pytho Programmig, 2/e 1 Objectives To uderstad why programmers divide programs up ito sets of cooperatig fuctios. To be able to
More informationPrinceton University COS 217: Introduction to Programming Systems Fall 2005 Final Exam Answers
Priceto Uiversity COS 217: Itroductio to Programmig Systems Fall 2005 Fial Exam Aswers The exam was a three-hour, ope-book, ope-otes exam. Questio 1 (a) Sytax error: Ivalid declaratio statemet o lie 2.
More informationΤεχνολογία Λογισμικού
ΕΘΝΙΚΟ ΜΕΤΣΟΒΙΟ ΠΟΛΥΤΕΧΝΕΙΟ Σχολή Ηλεκτρολόγων Μηχανικών και Μηχανικών Υπολογιστών Τεχνολογία Λογισμικού, 7ο/9ο εξάμηνο 2018-2019 Τεχνολογία Λογισμικού Ν.Παπασπύρου, Αν.Καθ. ΣΗΜΜΥ, ickie@softlab.tua,gr
More informationGoals of the Lecture UML Implementation Diagrams
Goals of the Lecture UML Implemetatio Diagrams Object-Orieted Aalysis ad Desig - Fall 1998 Preset UML Diagrams useful for implemetatio Provide examples Next Lecture Ð A variety of topics o mappig from
More informationCS 11 C track: lecture 1
CS 11 C track: lecture 1 Prelimiaries Need a CMS cluster accout http://acctreq.cms.caltech.edu/cgi-bi/request.cgi Need to kow UNIX IMSS tutorial liked from track home page Track home page: http://courses.cms.caltech.edu/courses/cs11/material
More informationCMPT 125 Assignment 2 Solutions
CMPT 25 Assigmet 2 Solutios Questio (20 marks total) a) Let s cosider a iteger array of size 0. (0 marks, each part is 2 marks) it a[0]; I. How would you assig a poiter, called pa, to store the address
More informationChapter 9. Pointers and Dynamic Arrays. Copyright 2015 Pearson Education, Ltd.. All rights reserved.
Chapter 9 Poiters ad Dyamic Arrays Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 9.1 Poiters 9.2 Dyamic Arrays Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Slide 9-3
More informationCOMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. Chapter 4. The Processor. Single-Cycle Disadvantages & Advantages
COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Iterface 5 th Editio Chapter 4 The Processor Pipeliig Sigle-Cycle Disadvatages & Advatages Clk Uses the clock cycle iefficietly the clock cycle must
More informationBasic allocator mechanisms The course that gives CMU its Zip! Memory Management II: Dynamic Storage Allocation Mar 6, 2000.
5-23 The course that gives CM its Zip Memory Maagemet II: Dyamic Storage Allocatio Mar 6, 2000 Topics Segregated lists Buddy system Garbage collectio Mark ad Sweep Copyig eferece coutig Basic allocator
More informationPython Programming: An Introduction to Computer Science
Pytho Programmig: A Itroductio to Computer Sciece Chapter 1 Computers ad Programs 1 Objectives To uderstad the respective roles of hardware ad software i a computig system. To lear what computer scietists
More informationMulti-Threading. Hyper-, Multi-, and Simultaneous Thread Execution
Multi-Threadig Hyper-, Multi-, ad Simultaeous Thread Executio 1 Performace To Date Icreasig processor performace Pipeliig. Brach predictio. Super-scalar executio. Out-of-order executio. Caches. Hyper-Threadig
More informationCOMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. Chapter 4. The Processor. Part A Datapath Design
COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Iterface 5 th Editio Chapter The Processor Part A path Desig Itroductio CPU performace factors Istructio cout Determied by ISA ad compiler. CPI ad
More informationΤεχνολογία Λογισμικού
ΕΘΝΙΚΟ ΜΕΤΣΟΒΙΟ ΠΟΛΥΤΕΧΝΕΙΟ Σχολή Ηλεκτρολόγων Μηχανικών και Μηχανικών Υπολογιστών Τεχνολογία Λογισμικού, 7ο/9ο εξάμηνο 2018-2019 Τεχνολογία Λογισμικού Ν.Παπασπύρου, Αν.Καθ. ΣΗΜΜΥ, ickie@softlab.tua,gr
More informationCSC 220: Computer Organization Unit 11 Basic Computer Organization and Design
College of Computer ad Iformatio Scieces Departmet of Computer Sciece CSC 220: Computer Orgaizatio Uit 11 Basic Computer Orgaizatio ad Desig 1 For the rest of the semester, we ll focus o computer architecture:
More informationElementary Educational Computer
Chapter 5 Elemetary Educatioal Computer. Geeral structure of the Elemetary Educatioal Computer (EEC) The EEC coforms to the 5 uits structure defied by vo Neuma's model (.) All uits are preseted i a simplified
More informationProcess Management 1
Process Management 1 Goals of this Lecture Help you learn about: Creating new processes Programmatically redirecting stdin, stdout, and stderr (Appendix) communication between processes via pipes Why?
More informationData diverse software fault tolerance techniques
Data diverse software fault tolerace techiques Complemets desig diversity by compesatig for desig diversity s s limitatios Ivolves obtaiig a related set of poits i the program data space, executig the
More informationThreads. They are peers in the same process. Motivation for threads. What is a thread? Fork is expensive.
1 2 Threads They are peers i the same process. What is a thread? A thread is a executio stream withi a process with its ow stack, local variables, ad program couter. There may be more tha oe executio stream
More informationJava net programming II
Java et programmig II https://docs.oracle.com/javase/tutorial/etworkig/sockets/ Overview The problem Basic backgroud: TCP/IP, ports, Cliet/Server, sockets Commuicatio with sockets java.et (overview) Simple
More informationChapter 1. Introduction to Computers and C++ Programming. Copyright 2015 Pearson Education, Ltd.. All rights reserved.
Chapter 1 Itroductio to Computers ad C++ Programmig Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 1.1 Computer Systems 1.2 Programmig ad Problem Solvig 1.3 Itroductio to C++ 1.4 Testig
More informationIXS-6600-C IXS-6700-C
INTEGRATED ROUTING SYSTEM PACK IXS-6600-C IXS-6700-C INTEGRATED ROUTING SYSTEM IXS-6600 IXS-6700 IKS-6030M IKS-A6011 IKS-A6015 IKS-A6050 IKS-A6061 IKS-V6010M IKS-V6010SD IKS-V6050M IKS-V6050SD IKS-V6060M
More informationTHE PROCESS IS ONE OF THE FUNDAMENTAL abstractions in Unix operating systems 1.A
3 Process Maagemet THE PROCESS IS ONE OF THE FUNDAMENTAL abstractios i Uix operatig systems 1.A process is a program (object code stored o some media) i executio. Processes are, however, more tha just
More informationCIS 121 Data Structures and Algorithms with Java Spring Stacks and Queues Monday, February 12 / Tuesday, February 13
CIS Data Structures ad Algorithms with Java Sprig 08 Stacks ad Queues Moday, February / Tuesday, February Learig Goals Durig this lab, you will: Review stacks ad queues. Lear amortized ruig time aalysis
More informationCopyright 2016 Ramez Elmasri and Shamkant B. Navathe
Copyright 2016 Ramez Elmasri ad Shamkat B. Navathe CHAPTER 20 Itroductio to Trasactio Processig Cocepts ad Theory Copyright 2016 Ramez Elmasri ad Shamkat B. Navathe Itroductio Trasactio Describes local
More informationCOSC 1P03. Ch 7 Recursion. Introduction to Data Structures 8.1
COSC 1P03 Ch 7 Recursio Itroductio to Data Structures 8.1 COSC 1P03 Recursio Recursio I Mathematics factorial Fiboacci umbers defie ifiite set with fiite defiitio I Computer Sciece sytax rules fiite defiitio,
More informationProcesses COMPSCI 386
Processes COMPSCI 386 Elements of a Process A process is a program in execution. Distinct processes may be created from the same program, but they are separate execution sequences. call stack heap STACK
More informationChapter 10. Defining Classes. Copyright 2015 Pearson Education, Ltd.. All rights reserved.
Chapter 10 Defiig Classes Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 10.1 Structures 10.2 Classes 10.3 Abstract Data Types 10.4 Itroductio to Iheritace Copyright 2015 Pearso Educatio,
More informationProcess Creation in UNIX
Process Creation in UNIX int fork() create a child process identical to parent Child process has a copy of the address space of the parent process On success: Both parent and child continue execution at
More informationBaan Tools User Management
Baa Tools User Maagemet Module Procedure UP008A US Documetiformatio Documet Documet code : UP008A US Documet group : User Documetatio Documet title : User Maagemet Applicatio/Package : Baa Tools Editio
More informationArchitectural styles for software systems The client-server style
Architectural styles for software systems The cliet-server style Prof. Paolo Ciacarii Software Architecture CdL M Iformatica Uiversità di Bologa Ageda Cliet server style CS two tiers CS three tiers CS
More informationCSI Module 2: Processes
CSI3131 - Module 2: es Reading: Chapter 3 (Silberchatz) Objective: To understand the nature of processes including the following concepts: states, the PCB (process control block), and process switching.
More informationPrepared by Prof. Hui Jiang Process. Prof. Hui Jiang Dept of Electrical Engineering and Computer Science, York University
EECS3221.3 Operating System Fundamentals No.2 Process Prof. Hui Jiang Dept of Electrical Engineering and Computer Science, York University How OS manages CPU usage? How CPU is used? Users use CPU to run
More informationEnd Semester Examination CSE, III Yr. (I Sem), 30002: Computer Organization
Ed Semester Examiatio 2013-14 CSE, III Yr. (I Sem), 30002: Computer Orgaizatio Istructios: GROUP -A 1. Write the questio paper group (A, B, C, D), o frot page top of aswer book, as per what is metioed
More informationCPSC 341 OS & Networks. Processes. Dr. Yingwu Zhu
CPSC 341 OS & Networks Processes Dr. Yingwu Zhu Process Concept Process a program in execution What is not a process? -- program on a disk A process is an active object, but a program is just a file It
More informationProcess. Prepared by Prof. Hui Jiang Dept. of EECS, York Univ. 1. Process in Memory (I) PROCESS. Process. How OS manages CPU usage? No.
EECS3221.3 Operating System Fundamentals No.2 Prof. Hui Jiang Dept of Electrical Engineering and Computer Science, York University How OS manages CPU usage? How CPU is used? Users use CPU to run programs
More informationChapter 11. Friends, Overloaded Operators, and Arrays in Classes. Copyright 2014 Pearson Addison-Wesley. All rights reserved.
Chapter 11 Frieds, Overloaded Operators, ad Arrays i Classes Copyright 2014 Pearso Addiso-Wesley. All rights reserved. Overview 11.1 Fried Fuctios 11.2 Overloadig Operators 11.3 Arrays ad Classes 11.4
More informationCopyright 2016 Ramez Elmasri and Shamkant B. Navathe
Copyright 2016 Ramez Elmasri ad Shamkat B. Navathe CHAPTER 22 Database Recovery Techiques Copyright 2016 Ramez Elmasri ad Shamkat B. Navathe Itroductio Recovery algorithms Recovery cocepts Write-ahead
More informationAvid Interplay Bundle
Avid Iterplay Budle Versio 2.5 Cofigurator ReadMe Overview This documet provides a overview of Iterplay Budle v2.5 ad describes how to ru the Iterplay Budle cofiguratio tool. Iterplay Budle v2.5 refers
More informationProcesses. Process Concept
Processes These slides are created by Dr. Huang of George Mason University. Students registered in Dr. Huang s courses at GMU can make a single machine readable copy and print a single copy of each slide
More information. Written in factored form it is easy to see that the roots are 2, 2, i,
CMPS A Itroductio to Programmig Programmig Assigmet 4 I this assigmet you will write a java program that determies the real roots of a polyomial that lie withi a specified rage. Recall that the roots (or
More informationICS Regent. Communications Modules. Module Operation. RS-232, RS-422 and RS-485 (T3150A) PD-6002
ICS Reget Commuicatios Modules RS-232, RS-422 ad RS-485 (T3150A) Issue 1, March, 06 Commuicatios modules provide a serial commuicatios iterface betwee the cotroller ad exteral equipmet. Commuicatios modules
More informationtop() Applications of Stacks
CS22 Algorithms ad Data Structures MW :00 am - 2: pm, MSEC 0 Istructor: Xiao Qi Lecture 6: Stacks ad Queues Aoucemets Quiz results Homework 2 is available Due o September 29 th, 2004 www.cs.mt.edu~xqicoursescs22
More informationProgramming with Shared Memory PART II. HPC Spring 2017 Prof. Robert van Engelen
Programmig with Shared Memory PART II HPC Sprig 2017 Prof. Robert va Egele Overview Sequetial cosistecy Parallel programmig costructs Depedece aalysis OpeMP Autoparallelizatio Further readig HPC Sprig
More informationChapter 4 The Datapath
The Ageda Chapter 4 The Datapath Based o slides McGraw-Hill Additioal material 24/25/26 Lewis/Marti Additioal material 28 Roth Additioal material 2 Taylor Additioal material 2 Farmer Tae the elemets that
More informationESE 333 Real-Time Operating Systems 2 What is an operating system? Two views: 1. Top-down view: Extended machine ffl Covers the details of the hardwar
1 A computer system consists of: ffl Hardware Physical devices Λ Processors Λ Memory Λ I/O devices Microprogramming Machine language (instruction set) ffl Software System programs Λ Operating system Λ
More information% Sun Logo for. X3T10/95-229, Revision 0. April 18, 1998
Su Microsystems, Ic. 2550 Garcia Aveue Moutai View, CA 94045 415 960-1300 X3T10/95-229, Revisio 0 April 18, 1998 % Su Logo for Joh Lohmeyer Chairperso, X3T10 Symbios Logic Ic. 1635 Aeroplaza Drive Colorado
More informationExceptions. Your computer takes exception. The Exception Class. Causes of Exceptions
Your computer takes exceptio s s are errors i the logic of a program (ru-time errors). Examples: i thread mai java.io.filenotfoud: studet.txt (The system caot fid the file specified.) i thread mai java.lag.nullpoiter:
More informationAPPLICATION NOTE PACE1750AE BUILT-IN FUNCTIONS
APPLICATION NOTE PACE175AE BUILT-IN UNCTIONS About This Note This applicatio brief is iteded to explai ad demostrate the use of the special fuctios that are built ito the PACE175AE processor. These powerful
More information3.1 Overview of MySQL Programs. These programs are discussed further in Chapter 4, Database Administration. Client programs that access the server:
3 Usig MySQL Programs This chapter provides a brief overview of the programs provided by MySQL AB ad discusses how to specify optios whe you ru these programs. Most programs have optios that are specific
More informationAbstract Data Types (ADTs) Stacks. The Stack ADT ( 4.2) Stack Interface in Java
Abstract Data Types (ADTs) tacks A abstract data type (ADT) is a abstractio of a data structure A ADT specifies: Data stored Operatios o the data Error coditios associated with operatios Example: ADT modelig
More informationUNIVERSITY OF MORATUWA
UNIVERSITY OF MORATUWA FACULTY OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING B.Sc. Egieerig 2014 Itake Semester 2 Examiatio CS2052 COMPUTER ARCHITECTURE Time allowed: 2 Hours Jauary 2016
More informationWORKED EXAMPLE 7.1. Producing a Mass Mailing. We want to automate the process of producing mass mailings. A typical letter might look as follows:
Worked Example 7.1 Producig a Mass Mailig 1 WORKED EXAMPLE 7.1 Producig a Mass Mailig We wat to automate the process of producig mass mailigs. A typical letter might look as follows: To: Ms. Sally Smith
More informationProcess a program in execution; process execution must progress in sequential fashion. Operating Systems
Process Concept An operating system executes a variety of programs: Batch system jobs Time-shared systems user programs or tasks 1 Textbook uses the terms job and process almost interchangeably Process
More informationProcesses and More. CSCI 315 Operating Systems Design Department of Computer Science
Processes and More CSCI 315 Operating Systems Design Department of Computer Science Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating Systems Concepts,
More informationCS61C : Machine Structures
CS 61C L24 VM II (1) ist.eecs.berkele.edu/~cs61c/su5 CS61C : Machie Structures Lecture #24: VM II Address Mappig: Virtual Address: VPN offset 25-8-2 Ad Carle idex ito page table located i phsical memor
More informationCluster Computing Spring 2004 Paul A. Farrell
Cluster Computig Sprig 004 3/18/004 Parallel Programmig Overview Task Parallelism OS support for task parallelism Parameter Studies Domai Decompositio Sequece Matchig Work Assigmet Static schedulig Divide
More informationThreads and Concurrency in Java: Part 2
Threads ad Cocurrecy i Java: Part 2 1 Waitig Sychroized methods itroduce oe kid of coordiatio betwee threads. Sometimes we eed a thread to wait util a specific coditio has arise. 2003--09 T. S. Norvell
More informationWeb OS Switch Software
Web OS Switch Software BBI Quick Guide Nortel Networks Part Number: 213164, Revisio A, July 2000 50 Great Oaks Boulevard Sa Jose, Califoria 95119 408-360-5500 Mai 408-360-5501 Fax www.orteletworks.com
More informationPROCESSES. Jo, Heeseung
PROCESSES Jo, Heeseung TODAY'S TOPICS What is the process? How to implement processes? Inter-Process Communication (IPC) 2 WHAT IS THE PROCESS? Program? vs. Process? vs. Processor? 3 PROCESS CONCEPT (1)
More informationProcesses. Jo, Heeseung
Processes Jo, Heeseung Today's Topics What is the process? How to implement processes? Inter-Process Communication (IPC) 2 What Is The Process? Program? vs. Process? vs. Processor? 3 Process Concept (1)
More informationn Learn how resiliency strategies reduce risk n Discover automation strategies to reduce risk
Chapter Objectives Lear how resiliecy strategies reduce risk Discover automatio strategies to reduce risk Chapter #16: Architecture ad Desig Resiliecy ad Automatio Strategies 2 Automatio/Scriptig Resiliet
More informationCOMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. Chapter 4. The Processor Advanced Issues
COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Iterface 5 th Editio Chapter 4 The Processor Advaced Issues Review: Pipelie Hazards Structural hazards Desig pipelie to elimiate structural hazards.
More informationChapter 4: Processes
Chapter 4: Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication in Client-Server Systems 4.1 Process Concept An operating
More informationPROCESS MANAGEMENT. Operating Systems 2015 Spring by Euiseong Seo
PROCESS MANAGEMENT Operating Systems 2015 Spring by Euiseong Seo Today s Topics Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication
More informationProcess Management! Goals of this Lecture!
Process Management! 1 Goals of this Lecture! Help you learn about:" Creating new processes" Programmatically redirecting stdin, stdout, and stderr" (Appendix) communication between processes via pipes"
More informationL I N U X. Unit 6 S Y S T E M DHCP & DNS (BIND) A D M I N I S T R A T I O n DPW
it 6 HCP & (B) oa Warre HCP ervice yamically assigs a P address to requestig machies P addresses are leased scope of addresses ca be assiged or excluded from assigmet HCP servers do ot talk to each other
More informationProcess. Program Vs. process. During execution, the process may be in one of the following states
What is a process? What is process scheduling? What are the common operations on processes? How to conduct process-level communication? How to conduct client-server communication? Process is a program
More informationLecture 2 Fundamental OS Concepts. Bo 2018, Spring
Lecture 2 Fundamental OS Concepts Bo Tang @ 2018, Spring Our Roadmap Computer Organization Revision Kernel Data Structures in OS OS History Four fundamental OS concepts Thread Address space (with translation)
More informationOperating System Concepts. Operating System Concepts
Chapter 4: Mass-Storage Systems Logical Disk Structure Logical Disk Structure Disk Schedulig Disk Maagemet RAID Structure Disk drives are addressed as large -dimesioal arrays of logical blocks, where the
More informationBEA WebLogic Process Integrator
BEA WebLogic Process Itegrator A Compoet of BEA WebLogic Itegratio BEA WebLogic Process Itegrator Studio Olie Help BEA WebLogic Process Itegrator Release 2.0 Documet Editio 2.0 July 2001 Copyright Copyright
More informationSystem Calls and Signals: Communication with the OS. System Call. strace./hello. Kernel. Context Switch
System Calls and Signals: Communication with the OS Jonathan Misurda jmisurda@cs.pitt.edu System Call An operation (function) that an OS provides for running applications to use CS 1550 2077 strace./hello
More informationLecture 11: PI/T parallel I/O, part I
Lecture 11: PI/T parallel I/O, part I Geeral descriptio of the parallel I/O fuctio Bufferi Hadshaki Iput ad Output trasfers Timi Diarams Reister model of the 68230 Port Geeral Cotrol Reister (PGCR) Port
More informationRecursion. Recursion. Mathematical induction: example. Recursion. The sum of the first n odd numbers is n 2 : Informal proof: Principle:
Recursio Recursio Jordi Cortadella Departmet of Computer Sciece Priciple: Reduce a complex problem ito a simpler istace of the same problem Recursio Itroductio to Programmig Dept. CS, UPC 2 Mathematical
More informationOne advantage that SONAR has over any other music-sequencing product I ve worked
*gajedra* D:/Thomso_Learig_Projects/Garrigus_163132/z_productio/z_3B2_3D_files/Garrigus_163132_ch17.3d, 14/11/08/16:26:39, 16:26, page: 647 17 CAL 101 Oe advatage that SONAR has over ay other music-sequecig
More informationSection 2: Processes
September 7, 2016 Contents 1 Warmup 2 1.1 Hello World............................................ 2 2 Vocabulary 2 3 Problems 3 3.1 Forks................................................ 3 3.2 Stack Allocation.........................................
More informationTCL Command Quick Reference Guide
TL ommad Quick Referece Guide -BRT borts a -SEN or -REV data trasfer o the remote system. -BRT (optios) Suppress the 'abort message'. acel the remaiig data i the iput buffer comig from remote system. Eter
More informationLecture 28: Data Link Layer
Automatic Repeat Request (ARQ) 2. Go ack N ARQ Although the Stop ad Wait ARQ is very simple, you ca easily show that it has very the low efficiecy. The low efficiecy comes from the fact that the trasmittig
More information10/23/18. File class in Java. Scanner reminder. Files. Opening a file for reading. Scanner reminder. File Input and Output
File class i Java File Iput ad Output TOPICS File Iput Exceptio Hadlig File Output Programmers refer to iput/output as "I/O". The File class represets files as objects. The class is defied i the java.io
More informationGuaranteeing Hard Real Time End-to-End Communications Deadlines
Guarateeig Hard Real Time Ed-to-Ed Commuicatios Deadlies K. W. Tidell A. Burs A. J. Welligs Real Time Systems Research Group Departmet of Computer Sciece Uiversity of York e-mail: ke@mister.york.ac.uk
More informationChapter 3: Processes. Operating System Concepts Essentials 8 th Edition
Chapter 3: Processes Silberschatz, Galvin and Gagne 2011 Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication
More informationProcesses. Processes (cont d)
Processes UNIX process creation image-file arg1 arg2 Shell command line example ls -l Equivalent to /bin/ls -l Why? How do you find out where the image file is? Background processes ls -l & Execute a process
More informationCS240: Programming in C
CS240: Programming in C Lecture 16: Process and Signals Cristina Nita-Rotaru Lecture 16/ Fall 2013 1 Processes in UNIX UNIX identifies processes via a unique Process ID Each process also knows its parent
More informationCOP4020 Programming Languages. Compilers and Interpreters Prof. Robert van Engelen
COP4020 mig Laguages Compilers ad Iterpreters Prof. Robert va Egele Overview Commo compiler ad iterpreter cofiguratios Virtual machies Itegrated developmet eviromets Compiler phases Lexical aalysis Sytax
More informationAdapter for Mainframe
BEA WebLogic Java Adapter for Maiframe Workflow Processig Guide Release 5.0 Documet Date: Jauary 2002 Copyright Copyright 2002 BEA Systems, Ic. All Rights Reserved. Restricted Rights Leged This software
More informationRecursion. Computer Science S-111 Harvard University David G. Sullivan, Ph.D. Review: Method Frames
Uit 4, Part 3 Recursio Computer Sciece S-111 Harvard Uiversity David G. Sulliva, Ph.D. Review: Method Frames Whe you make a method call, the Java rutime sets aside a block of memory kow as the frame of
More informationPart V. Process Management. Sadeghi, Cubaleska RUB Course Operating System Security Memory Management and Protection
Part V Process Management Sadeghi, Cubaleska RUB 2008-09 Course Operating System Security Memory Management and Protection Roadmap of Chapter 5 Notion of Process and Thread Data Structures Used to Manage
More informationReview: The ACID properties
Recovery Review: The ACID properties A tomicity: All actios i the Xactio happe, or oe happe. C osistecy: If each Xactio is cosistet, ad the DB starts cosistet, it eds up cosistet. I solatio: Executio of
More informationUnit 4. NFS and Samba
it 4 F ad amba oa Warre F (etwork File ystem) F allows remote access to files o a Liux system he F cliet logs ito the F server ad mouts the exported directories i at a local l mout poit hared files ca
More informationCSE 153 Design of Operating Systems Fall 2018
CSE 153 Design of Operating Systems Fall 2018 Lecture 4: Processes (2) Threads Process Creation: Unix In Unix, processes are created using fork() int fork() fork() Creates and initializes a new PCB Creates
More information