Friday, September 23, Pintos

Size: px
Start display at page:

Download "Friday, September 23, Pintos"

Transcription

1 Pintos

2 Kernel structure UNIX-like Monolithic Unithreading, multiprogramming No virtual memory Bare-bones file system Preemptible

3 Threads New thread == new context Sort of a miniprogram Runs until return idle thread Small, fixed-size kernel stack

4 Source code threads userprog devices lib, lib/kernel, lib/user tests

5 Running Pintos Build with make cd pintos/src/threads; make; cd build Use pintos script export PATH=/cs/home/stu-f/kirkpams/450-f11/bin:$PATH pintos -k -v -T run alarm-multiple

6 build]$ pintos -k -v -T run alarm-multiple qemu -hda /tmp/xu702f92cr.dsk -m 4 -net none -nographic -monitor null PiLo hda1 Loading... Kernel command line: run alarm-multiple Pintos booting with 4,096 kb RAM pages available in kernel pool. 383 pages available in user pool. Calibrating timer ,755,200 loops/s. Boot complete. Executing 'alarm-multiple': (alarm-multiple) begin (alarm-multiple) Creating 5 threads to sleep 7 times each. (alarm-multiple) Thread 0 sleeps 10 ticks each time, (alarm-multiple) thread 1 sleeps 20 ticks each time, and so on. (alarm-multiple) If successful, product of iteration count and (alarm-multiple) sleep duration will appear in nondescending order. (alarm-multiple) thread 0: duration=10, iteration=1, product=10 (alarm-multiple) thread 0: duration=10, iteration=2, product=20... (alarm-multiple) thread 4: duration=50, iteration=7, product=350 (alarm-multiple) end Execution of 'alarm-multiple' complete. TIMEOUT after 35 seconds of wall-clock time - load average: 1.12, 1.08, 1.02

7 build]$ pintos -k -v -T run alarm-multiple qemu -hda /tmp/xu702f92cr.dsk -m 4 -net none -nographic -monitor null PiLo hda1 Loading... Kernel command line: run alarm-multiple Pintos booting with 4,096 kb RAM pages available in kernel pool. 383 pages available in user pool. Calibrating timer ,755,200 loops/s. Boot complete. Executing 'alarm-multiple': (alarm-multiple) begin (alarm-multiple) Creating 5 threads to sleep 7 times each. (alarm-multiple) Thread 0 sleeps 10 ticks each time, (alarm-multiple) thread 1 sleeps 20 ticks each time, and so on. (alarm-multiple) If successful, product of iteration count and (alarm-multiple) sleep duration will appear in nondescending order. (alarm-multiple) thread 0: duration=10, iteration=1, product=10 (alarm-multiple) thread 0: duration=10, iteration=2, product=20... (alarm-multiple) thread 4: duration=50, iteration=7, product=350 (alarm-multiple) end Execution of 'alarm-multiple' complete. TIMEOUT after 35 seconds of wall-clock time - load average: 1.12, 1.08, 1.02

8 build]$ pintos -k -v -T run alarm-multiple qemu -hda /tmp/xu702f92cr.dsk -m 4 -net none -nographic -monitor null PiLo hda1 Loading... Kernel command line: run alarm-multiple Pintos booting with 4,096 kb RAM pages available in kernel pool. 383 pages available in user pool. Calibrating timer ,755,200 loops/s. Boot complete. Executing 'alarm-multiple': (alarm-multiple) begin (alarm-multiple) Creating 5 threads to sleep 7 times each. (alarm-multiple) Thread 0 sleeps 10 ticks each time, (alarm-multiple) thread 1 sleeps 20 ticks each time, and so on. (alarm-multiple) If successful, product of iteration count and (alarm-multiple) sleep duration will appear in nondescending order. (alarm-multiple) thread 0: duration=10, iteration=1, product=10 (alarm-multiple) thread 0: duration=10, iteration=2, product=20... (alarm-multiple) thread 4: duration=50, iteration=7, product=350 (alarm-multiple) end Execution of 'alarm-multiple' complete. TIMEOUT after 35 seconds of wall-clock time - load average: 1.12, 1.08, 1.02

9 build]$ make tests/threads/alarm-zero.result pintos -v -k -T 60 --qemu -- -q run alarm-zero < /dev/null 2> tests/ threads/alarm-zero.errors > tests/threads/alarm-zero.output make: *** [tests/threads/alarm-zero.output] Error 127 build]$ export PATH=/cs/home/stu-f/kirkpams/450-f11/bin:$PATH build]$ make tests/threads/alarm-zero.result perl -I../..../../tests/threads/alarm-zero.ck tests/threads/alarm-zero tests/threads/alarm-zero.result FAIL tests/threads/alarm-zero Run produced no output at all build]$ rm tests/threads/alarm-zero.* build]$ make tests/threads/alarm-zero.result gcc -m32 -c../../tests/threads/alarm-zero.c -o tests/threads/alarm-... objcopy -R.note -R.comment -S kernel.o kernel.bin pintos -v -k -T 60 --qemu -- -q run alarm-zero < /dev/null 2> tests/ threads/alarm-zero.errors > tests/threads/alarm-zero.output perl -I../..../../tests/threads/alarm-zero.ck tests/threads/alarm-zero tests/threads/alarm-zero.result pass tests/threads/alarm-zero

10 build]$ make tests/threads/alarm-zero.result pintos -v -k -T 60 --qemu -- -q run alarm-zero < /dev/null 2> tests/ threads/alarm-zero.errors > tests/threads/alarm-zero.output make: *** [tests/threads/alarm-zero.output] Error 127 build]$ export PATH=/cs/home/stu-f/kirkpams/450-f11/bin:$PATH build]$ make tests/threads/alarm-zero.result perl -I../..../../tests/threads/alarm-zero.ck tests/threads/alarm-zero tests/threads/alarm-zero.result FAIL tests/threads/alarm-zero Run produced no output at all build]$ rm tests/threads/alarm-zero.* build]$ make tests/threads/alarm-zero.result gcc -m32 -c../../tests/threads/alarm-zero.c -o tests/threads/alarm-... objcopy -R.note -R.comment -S kernel.o kernel.bin pintos -v -k -T 60 --qemu -- -q run alarm-zero < /dev/null 2> tests/ threads/alarm-zero.errors > tests/threads/alarm-zero.output perl -I../..../../tests/threads/alarm-zero.ck tests/threads/alarm-zero tests/threads/alarm-zero.result pass tests/threads/alarm-zero

11 build]$ make tests/threads/alarm-zero.result pintos -v -k -T 60 --qemu -- -q run alarm-zero < /dev/null 2> tests/ threads/alarm-zero.errors > tests/threads/alarm-zero.output make: *** [tests/threads/alarm-zero.output] Error 127 build]$ export PATH=/cs/home/stu-f/kirkpams/450-f11/bin:$PATH build]$ make tests/threads/alarm-zero.result perl -I../..../../tests/threads/alarm-zero.ck tests/threads/alarm-zero tests/threads/alarm-zero.result FAIL tests/threads/alarm-zero Run produced no output at all build]$ rm tests/threads/alarm-zero.* build]$ make tests/threads/alarm-zero.result gcc -m32 -c../../tests/threads/alarm-zero.c -o tests/threads/alarm-... objcopy -R.note -R.comment -S kernel.o kernel.bin pintos -v -k -T 60 --qemu -- -q run alarm-zero < /dev/null 2> tests/ threads/alarm-zero.errors > tests/threads/alarm-zero.output perl -I../..../../tests/threads/alarm-zero.ck tests/threads/alarm-zero tests/threads/alarm-zero.result pass tests/threads/alarm-zero

12 build]$ make tests/threads/alarm-zero.result pintos -v -k -T 60 --qemu -- -q run alarm-zero < /dev/null 2> tests/ threads/alarm-zero.errors > tests/threads/alarm-zero.output make: *** [tests/threads/alarm-zero.output] Error 127 build]$ export PATH=/cs/home/stu-f/kirkpams/450-f11/bin:$PATH build]$ make tests/threads/alarm-zero.result perl -I../..../../tests/threads/alarm-zero.ck tests/threads/alarm-zero tests/threads/alarm-zero.result FAIL tests/threads/alarm-zero Run produced no output at all build]$ rm tests/threads/alarm-zero.* build]$ make tests/threads/alarm-zero.result gcc -m32 -c../../tests/threads/alarm-zero.c -o tests/threads/alarm-... objcopy -R.note -R.comment -S kernel.o kernel.bin pintos -v -k -T 60 --qemu -- -q run alarm-zero < /dev/null 2> tests/ threads/alarm-zero.errors > tests/threads/alarm-zero.output perl -I../..../../tests/threads/alarm-zero.ck tests/threads/alarm-zero tests/threads/alarm-zero.result pass tests/threads/alarm-zero

13 build]$ make tests/threads/alarm-zero.result pintos -v -k -T 60 --qemu -- -q run alarm-zero < /dev/null 2> tests/ threads/alarm-zero.errors > tests/threads/alarm-zero.output make: *** [tests/threads/alarm-zero.output] Error 127 build]$ export PATH=/cs/home/stu-f/kirkpams/450-f11/bin:$PATH build]$ make tests/threads/alarm-zero.result perl -I../..../../tests/threads/alarm-zero.ck tests/threads/alarm-zero tests/threads/alarm-zero.result FAIL tests/threads/alarm-zero Run produced no output at all build]$ rm tests/threads/alarm-zero.* build]$ make tests/threads/alarm-zero.result gcc -m32 -c../../tests/threads/alarm-zero.c -o tests/threads/alarm-... objcopy -R.note -R.comment -S kernel.o kernel.bin pintos -v -k -T 60 --qemu -- -q run alarm-zero < /dev/null 2> tests/ threads/alarm-zero.errors > tests/threads/alarm-zero.output perl -I../..../../tests/threads/alarm-zero.ck tests/threads/alarm-zero tests/threads/alarm-zero.result pass tests/threads/alarm-zero

14 build]$ make tests/threads/alarm-zero.result pintos -v -k -T 60 --qemu -- -q run alarm-zero < /dev/null 2> tests/ threads/alarm-zero.errors > tests/threads/alarm-zero.output make: *** [tests/threads/alarm-zero.output] Error 127 build]$ export PATH=/cs/home/stu-f/kirkpams/450-f11/bin:$PATH build]$ make tests/threads/alarm-zero.result perl -I../..../../tests/threads/alarm-zero.ck tests/threads/alarm-zero tests/threads/alarm-zero.result FAIL tests/threads/alarm-zero Run produced no output at all build]$ rm tests/threads/alarm-zero.* build]$ make tests/threads/alarm-zero.result gcc -m32 -c../../tests/threads/alarm-zero.c -o tests/threads/alarm-... objcopy -R.note -R.comment -S kernel.o kernel.bin pintos -v -k -T 60 --qemu -- -q run alarm-zero < /dev/null 2> tests/ threads/alarm-zero.errors > tests/threads/alarm-zero.output perl -I../..../../tests/threads/alarm-zero.ck tests/threads/alarm-zero tests/threads/alarm-zero.result pass tests/threads/alarm-zero

15 Project phases Alarm clock Change devices/timer.c, threads/thread.c Due 10/4 at 11:59 PM Priority scheduling Priority donation Most difficult part

16 Synchronization Disabling interrupts enum intr_level old_level; old_level = intr_disable (); /* critical section */ intr_set_level (old_level); Locks Good for protecting a data structure lock_init (&my_lock); // done once lock_acquire (&my_lock); /* critical section */ lock_release (&my_lock);

17 Synchronization Disabling interrupts last resort enum intr_level old_level; old_level = intr_disable (); /* critical section */ intr_set_level (old_level); Locks Good for protecting a data structure lock_init (&my_lock); // done once lock_acquire (&my_lock); /* critical section */ lock_release (&my_lock);

18 Synchronization Disabling interrupts last resort enum intr_level old_level; old_level = intr_disable (); /* critical section */ intr_set_level (old_level); Locks Good for protecting a data structure lock_init (&my_lock); // done once lock_acquire (&my_lock); /* critical section */ lock_release (&my_lock); semaphore holder

19 Synchronization Condition variables Uses lock, but does additional check // must lock_init and cond_init once lock_acquire (&my_lock); while (...) cond_wait (&my_cond, &my_lock); /* critical section */ lock_release (&my_lock); // somewhere else... lock_acquire (&my_lock); cond_signal (&my_cond); lock_release (&my_lock);

20 Synchronization Condition variables Uses lock, but does additional check // must lock_init and cond_init once lock_acquire (&my_lock); while (...) cond_wait (&my_cond, &my_lock); /* critical section */ lock_release (&my_lock); // somewhere else... lock_acquire (&my_lock); cond_signal (&my_cond); lock_release (&my_lock); releases and reacquires lock

21 Synchronization value Semaphores Disables interrupts internally Maintains ordered queue of waiters sema_init (&my_sema, n); // done once // generally, n = 0 or 1 sema_down (&my_sema); // wait on semaphore /* critical section */ sema_up (&my_sema); // release semaphore

22 Linked lists

23 struct list Linked lists struct list_elem

24 struct list Linked lists struct list_elem Defined in lib/kernel/list.h list_init (&my_list); // done once list_push_back (&my_list, &my_item); list_pop_front (&my_list, &my_item); list_insert_ordered (&my_list, &my_item, my_order_function, NULL); bool my_order_function(const struct list_elem *a, const struct list_elem *b, void *aux UNUSED) { return (...(a))->some_field > (...(b))->some_field; }

25 struct list Linked lists struct list_elem Defined in lib/kernel/list.h list_init (&my_list); // done once list_push_back (&my_list, &my_item); list_pop_front (&my_list, &my_item); list_insert_ordered (&my_list, &my_item, my_order_function, NULL); bool my_order_function(const struct list_elem *a, const struct list_elem *b, void *aux UNUSED) { return (...(a))->some_field > (...(b))->some_field; }

26 struct list Linked lists struct list_elem Defined in lib/kernel/list.h list_init (&my_list); // done once list_push_back (&my_list, &my_item); list_pop_front (&my_list, &my_item); list_insert_ordered (&my_list, &my_item, my_order_function, NULL); my_item bool my_order_function(const struct list_elem *a, const struct list_elem *b, void *aux UNUSED) { return (...(a))->some_field > (...(b))->some_field; }

27 Linked lists Defined in lib/kernel/list.h struct list_elem *e; for (e = list_begin (&my_list); e!= list_end (&my_list); e = list_next (e)) { struct thread *t = list_entry (e, struct thread, elem); // do something to thread t }

28 Linked lists Scheduling list -- ready_list (threads/thread.c) static struct list ready_list; struct thread *cur = thread_current(); if (cur!= idle_thread) list_push_back (&ready_list, &cur->elem); cur->status = THREAD_READY;

29 Linked lists Scheduling list -- ready_list (threads/thread.c) static struct list ready_list; struct thread *cur = thread_current(); if (cur!= idle_thread) list_push_back (&ready_list, &cur->elem); cur->status = THREAD_READY;

CS Computer Systems. Project 1: Threads in Pintos

CS Computer Systems. Project 1: Threads in Pintos CS 5600 Computer Systems Project 1: Threads in Pintos Getting Started With Pintos What does Pintos Include? Threads in Pintos Project 1 2 What is Pintos? Pintos is a teaching operating system from Stanford

More information

Outline. TDDC47 Lesson 1: Pintos labs Assignments 0, 1, 2. Administration. A new kind of complexity. The Pintos boot process

Outline. TDDC47 Lesson 1: Pintos labs Assignments 0, 1, 2. Administration. A new kind of complexity. The Pintos boot process TDDC47 Lesson 1: Pintos labs Assignments 0, 1, 2 Jordi Cucurull, Mikael Asplund 2010 Administration Introduction to Pintos Scheduler Interrupts Synchronisation General description of labs Lab 1 Lab 2 Outline

More information

TDDB Lesson 2 Introduction to Pintos Assignments (1) and 2

TDDB Lesson 2 Introduction to Pintos Assignments (1) and 2 TDDB68 2015 Lesson 2 Introduction to Pintos Assignments (1) and 2 Erik Hansson erik.hansson@liu.se Most slides by Mattias Eriksson 2009-2010 and Viacheslav Izosimov 2007-2008. Outline Administration Introduction

More information

Section 7: Scheduling and Fairness

Section 7: Scheduling and Fairness March 1-2, 2018 Contents 1 Warmup 2 2 Vocabulary 2 3 Problems 3 3.1 Scheduling............................................. 3 3.2 Simple Priority Scheduler.................................... 4 3.2.1 Fairness..........................................

More information

김주남, 우병일, 최종은 *, Nick 박주호, 박진영 *, 안세건, 이대현

김주남, 우병일, 최종은 *, Nick 박주호, 박진영 *, 안세건, 이대현 Project Teams Team Name WINOS Prime Megatron Members 고경민 *, 홍종목, 유상훈 이경준, 김종석 *, 이현수 이태훈 *, 선우석, 오동근 닥코딩박재영*, 이경욱, 박병규 5분대기조박지용, 정종균, 김대호 * 김주남, 우병일, 최종은 *, Nick 박주호, 박진영 *, 안세건, 이대현 1 Project 1: Threads

More information

Project 1: Threads. Jin-Soo Kim ( Computer Systems Laboratory Sungkyunkwan University

Project 1: Threads. Jin-Soo Kim ( Computer Systems Laboratory Sungkyunkwan University Project 1: Threads Jin-Soo Kim ( jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu # of addr spaces: Pintos Kernel (1) The current Pintos kernel There is only

More information

ProgOS UE. Daniel Prokesch, Denise Ratasich. basierend auf Slides von Benedikt Huber, Roland Kammerer, Bernhard Frömel

ProgOS UE. Daniel Prokesch, Denise Ratasich. basierend auf Slides von Benedikt Huber, Roland Kammerer, Bernhard Frömel 1/50 Daniel Prokesch, Denise Ratasich basierend auf Slides von Benedikt Huber, Roland Kammerer, Bernhard Frömel Institut für Technische Informatik Technische Universität Wien - 182.710 Programmierung von

More information

CSCI 350 Pintos Intro. Mark Redekopp

CSCI 350 Pintos Intro. Mark Redekopp 1 CSCI 350 Pintos Intro Mark Redekopp 2 Resources Pintos Resources https://web.stanford.edu/class/cs140/projects/pintos/pintos.html#sec_top Skip Stanford related setup in section 1.1 and 1.1.1 http://bits.usc.edu/cs350/assignments/pintos_guide_2016_11_13.pdf

More information

TDDB68 Lesson 1 Introduction to Pintos Assignments 00, 0, 1, 2

TDDB68 Lesson 1 Introduction to Pintos Assignments 00, 0, 1, 2 TDDB68 Lesson 1 Introduction to Pintos Assignments 00, 0, 1, 2 Mattias Eriksson 2010 mater@ida.liu.se Some slides by Viacheslav Izosimov 2007-2008 Outline Administration Introduction to Pintos Important

More information

CSCI 350: Pintos Guide Written by: Stephen Tsung-Han Sher November 5, 2016

CSCI 350: Pintos Guide Written by: Stephen Tsung-Han Sher November 5, 2016 CSCI 350: Pintos Guide Written by: Stephen Tsung-Han Sher November 5, 2016 Introduction This guide serves to help you along the projects of Pintos for CSCI 350. The aim of this document is to minimize

More information

Pintos: Threads Project. Slides by: Vijay Kumar Updated by Godmar Back Presented by: Min Li

Pintos: Threads Project. Slides by: Vijay Kumar Updated by Godmar Back Presented by: Min Li Pintos: Threads Project Slides by: Vijay Kumar Updated by Godmar Back Presented by: Min Li Introduction to Pintos Simple OS for the 80x86 architecture Capable of running on real hardware We use bochs,

More information

CS140 Discussion Section 1 April 2014

CS140 Discussion Section 1 April 2014 CS140 Discussion Section 1 April 2014 Outline For Today Project Advice / Info Jumpstarting Project 1 Using Pintos Alarm Clock Priority Scheduling & Priority Donation Advanced Scheduler Semaphores 50% of

More information

CS 162 Project 1: Threads

CS 162 Project 1: Threads CS 162 Design Document Due: Friday, February 19, 2016 Code Due: Friday, March 4, 2016 Final Report Due: Monday, March 7, 2016 Contents 1 Your task 3 1.1 Task 1: Efficient Alarm Clock..................................

More information

CS 140. Lab 1 - Threads

CS 140. Lab 1 - Threads CS 140 Lab 1 - Threads setup lab 1 git general setup lab 1 git general Getting started with pintos http://www.scs.stanford.edu/14wics140/pintos/pintos_1.html Get the Source set your path set path = ( /usr/class/cs140/`uname

More information

CS 318 Principles of Operating Systems

CS 318 Principles of Operating Systems CS 318 Principles of Operating Systems Fall 2018 Lecture 7: Semaphores and Monitors Ryan Huang Slides adapted from Geoff Voelker s lectures Administrivia HW2 is out Do the exercise to check your understanding

More information

CS 318 Principles of Operating Systems

CS 318 Principles of Operating Systems CS 318 Principles of Operating Systems Fall 2017 Lecture 7: Semaphores and Monitors Ryan Huang Higher-Level Synchronization We looked at using locks to provide mutual exclusion Locks work, but they have

More information

Review: Thread package API

Review: Thread package API Review: Thread package API tid thread_create (void (*fn) (void *), void *arg); - Create a new thread that calls fn with arg void thread_exit (); void thread_join (tid thread); The execution of multiple

More information

Program A. Review: Thread package API. Program B. Program C. Correct answers. Correct answers. Q: Can both critical sections run?

Program A. Review: Thread package API. Program B. Program C. Correct answers. Correct answers. Q: Can both critical sections run? Review: Thread package API tid thread_create (void (*fn) (void *), void *arg); - Create a new thread that calls fn with arg void thread_exit (); void thread_join (tid thread); The execution of multiple

More information

cs 140 project 1: threads 9 January 2015

cs 140 project 1: threads 9 January 2015 cs 140 project 1: threads 9 January 2015 git The basics: git clone git add git commit git branch git merge git stash git pull git push git rebase git Some guidelines & ideas: Write helpful commit and stash

More information

Computer Science 162, Fall 2014 David Culler University of California, Berkeley Midterm 2 November 14, 2014

Computer Science 162, Fall 2014 David Culler University of California, Berkeley Midterm 2 November 14, 2014 Computer Science 162, Fall 2014 David Culler University of California, Berkeley Midterm 2 November 14, 2014 Name SID Login TA Name Section Time This is a closed book exam with one 2-sided page of notes

More information

TDDB Lesson 3 Pintos Assignments (2), 3 & 4. Erik Hansson

TDDB Lesson 3 Pintos Assignments (2), 3 & 4. Erik Hansson TDDB68 2015 Lesson 3 Pintos Assignments (2), 3 & 4 Erik Hansson erik.hansson@liu.se Most slides by Mattias Eriksson 2009-2010 and Viacheslav Izosimov 2007-2008 Remember Pass assignments on time to get

More information

Midterm Exam #1 September 28, 2016 CS162 Operating Systems

Midterm Exam #1 September 28, 2016 CS162 Operating Systems University of California, Berkeley College of Engineering Computer Science Division EECS Fall 2016 Anthony D. Joseph Midterm Exam #1 September 28, 2016 CS162 Operating Systems Your Name: SID AND 162 Login:

More information

Computer Science 162, Fall 2014 David Culler University of California, Berkeley Midterm 1 September 29, 2014

Computer Science 162, Fall 2014 David Culler University of California, Berkeley Midterm 1 September 29, 2014 Computer Science 162, Fall 2014 David Culler University of California, Berkeley Midterm 1 September 29, 2014 Name SID Login TA Name Section Time This is a closed book exam with one 2-sided page of notes

More information

Lecture #7: Implementing Mutual Exclusion

Lecture #7: Implementing Mutual Exclusion Lecture #7: Implementing Mutual Exclusion Review -- 1 min Solution #3 to too much milk works, but it is really unsatisfactory: 1) Really complicated even for this simple example, hard to convince yourself

More information

Midterm Exam #1 February 28, 2018 CS162 Operating Systems

Midterm Exam #1 February 28, 2018 CS162 Operating Systems University of California, Berkeley College of Engineering Computer Science Division EECS Spring 2018 Anthony D. Joseph and Jonathan Ragan-Kelley Midterm Exam #1 February 28, 2018 CS162 Operating Systems

More information

Computer Science 162, Fall 2014 David Culler University of California, Berkeley Midterm 2 November 14, 2014

Computer Science 162, Fall 2014 David Culler University of California, Berkeley Midterm 2 November 14, 2014 Computer Science 162, Fall 2014 David Culler University of California, Berkeley Midterm 2 November 14, 2014 Name SID Login TA Name Section Time This is a closed book exam with one 2-sided page of notes

More information

Midterm I February 28 th, 2019 CS162: Operating Systems and Systems Programming

Midterm I February 28 th, 2019 CS162: Operating Systems and Systems Programming Spring 2019 University of California, Berkeley College of Engineering Computer Science Division EECS John Kubiatowicz Midterm I February 28 th, 2019 CS162: Operating Systems and Systems Programming Your

More information

Condition Variables. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Condition Variables. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University Condition Variables Jinkyu Jeong (jinkyu@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu EEE3052: Introduction to Operating Systems, Fall 2017, Jinkyu Jeong (jinkyu@skku.edu)

More information

TDDB Lesson 2 Pintos Assignments (2), 3 & 4. Erik Hansson

TDDB Lesson 2 Pintos Assignments (2), 3 & 4. Erik Hansson TDDB68 2013 Lesson 2 Pintos Assignments (2), 3 & 4 Erik Hansson erik.hansson@liu.se Most slides by Mattias Eriksson 2009-2010 and Viacheslav Izosimov 2007-2008 Instead of Motivation Some of you should

More information

Section 7: Wait/Exit, Address Translation

Section 7: Wait/Exit, Address Translation William Liu October 15, 2014 Contents 1 Wait and Exit 2 1.1 Thinking about what you need to do.............................. 2 1.2 Code................................................ 2 2 Vocabulary 4

More information

Review: Processes. A process is an instance of a running program. POSIX Thread APIs:

Review: Processes. A process is an instance of a running program. POSIX Thread APIs: Review: Processes A process is an instance of a running program - A thread is an execution context - Process can have one or more threads - Threads share address space (code, data, heap), open files -

More information

Operating System. Project #

Operating System. Project # Operating System Project #5 16. 11. 28 Project Plan 5 projects Install Xv6 System call + scheduling Virtual memory (stack growth + COW) Thread-support Concurrency Single-handed project Syncronization on

More information

Last Class: Synchronization

Last Class: Synchronization Last Class: Synchronization Synchronization primitives are required to ensure that only one thread executes in a critical section at a time. Concurrent programs Low-level atomic operations (hardware) load/store

More information

CSCI 350: Getting Started with C Written by: Stephen Tsung-Han Sher June 12, 2016

CSCI 350: Getting Started with C Written by: Stephen Tsung-Han Sher June 12, 2016 CSCI 350: Getting Started with C Written by: Stephen Tsung-Han Sher June 12, 2016 Introduction As you have been informed, your work with Pintos will be almost exclusively with C. Since you have taken CSCI-103

More information

Introduction to Pintos

Introduction to Pintos Introduction to Pintos Prof. Jin-Soo Kim ( jinsookim@skku.edu) TAs Jong-Sung Lee (leitia@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Welcome to Pintos! What is

More information

Spring CS 170 Exercise Set 1 (Updated with Part III)

Spring CS 170 Exercise Set 1 (Updated with Part III) Spring 2015. CS 170 Exercise Set 1 (Updated with Part III) Due on May 5 Tuesday 12:30pm. Submit to the CS170 homework box or bring to the classroom. Additional problems will be added as we cover more topics

More information

EEE3052: Introduction to Operating Systems. Fall Project #3

EEE3052: Introduction to Operating Systems. Fall Project #3 EEE3052: Introduction to Operating Systems Fall 2017 Project #3 Project Plan 4 projects 0) Install Xv6 1) Process management 2) Virtual memory 3) Synchronization - Thread (11/13 ~ 11/21) - Mutex & Condition

More information

Today: Synchronization. Recap: Synchronization

Today: Synchronization. Recap: Synchronization Today: Synchronization Synchronization Mutual exclusion Critical sections Example: Too Much Milk Locks Synchronization primitives are required to ensure that only one thread executes in a critical section

More information

CROWDMARK. Examination Midterm. Spring 2017 CS 350. Closed Book. Page 1 of 30. University of Waterloo CS350 Midterm Examination.

CROWDMARK. Examination Midterm. Spring 2017 CS 350. Closed Book. Page 1 of 30. University of Waterloo CS350 Midterm Examination. Times: Thursday 2017-06-22 at 19:00 to 20:50 (7 to 8:50PM) Duration: 1 hour 50 minutes (110 minutes) Exam ID: 3520593 Please print in pen: Waterloo Student ID Number: WatIAM/Quest Login Userid: Sections:

More information

Last Class: CPU Scheduling! Adjusting Priorities in MLFQ!

Last Class: CPU Scheduling! Adjusting Priorities in MLFQ! Last Class: CPU Scheduling! Scheduling Algorithms: FCFS Round Robin SJF Multilevel Feedback Queues Lottery Scheduling Review questions: How does each work? Advantages? Disadvantages? Lecture 7, page 1

More information

Midterm Exam #1 Solutions February 28, 2018 CS162 Operating Systems

Midterm Exam #1 Solutions February 28, 2018 CS162 Operating Systems University of California, Berkeley College of Engineering Computer Science Division EECS Spring 2018 Anthony D. Joseph and Jonathan Ragan-Kelley Midterm Exam #1 Solutions February 28, 2018 CS162 Operating

More information

Last Class: Deadlocks. Today

Last Class: Deadlocks. Today Last Class: Deadlocks Necessary conditions for deadlock: Mutual exclusion Hold and wait No preemption Circular wait Ways of handling deadlock Deadlock detection and recovery Deadlock prevention Deadlock

More information

Zilog Real-Time Kernel

Zilog Real-Time Kernel An Company Configurable Compilation RZK allows you to specify system parameters at compile time. For example, the number of objects, such as threads and semaphores required, are specez80acclaim! Family

More information

EPL372 Lab Exercise 2: Threads and pthreads. Εργαστήριο 2. Πέτρος Παναγή

EPL372 Lab Exercise 2: Threads and pthreads. Εργαστήριο 2. Πέτρος Παναγή EPL372 Lab Exercise 2: Threads and pthreads Εργαστήριο 2 Πέτρος Παναγή 1 Threads Vs Processes 2 Process A process is created by the operating system, and requires a fair amount of "overhead". Processes

More information

Main Points. Defini&on. Design pa9ern Example: bounded buffer. Condi&on wait/signal/broadcast

Main Points. Defini&on. Design pa9ern Example: bounded buffer. Condi&on wait/signal/broadcast Condi&on Variables Main Points Defini&on Condi&on wait/signal/broadcast Design pa9ern Example: bounded buffer Last Time lock_acquire wait un&l lock is free, then take it lock_release release lock, waking

More information

CS 318 Principles of Operating Systems

CS 318 Principles of Operating Systems CS 318 Principles of Operating Systems Fall 2017 Lecture 5: Thread Ryan Huang Administrivia HW1 solution released on Piazza resources Lab 0 grading - In progress - Cheating policy Lab 1 review session

More information

CS 4284 Systems Capstone. Processes and Threads Godmar Back

CS 4284 Systems Capstone. Processes and Threads Godmar Back CS 4284 Systems Capstone Processes and Threads Godmar Back Processes & Threads Overview Definitions How does OS execute processes? How do kernel & processes interact How does kernel switch between processes

More information

ZiLOG Real-Time Kernel Version 1.2.0

ZiLOG Real-Time Kernel Version 1.2.0 ez80acclaim Family of Microcontrollers Version 1.2.0 PRELIMINARY Introduction The (RZK) is a realtime, preemptive, multitasking kernel designed for time-critical embedded applications. It is currently

More information

Announcements. Class feedback for mid-course evaluations Receive about survey to fill out until this Friday

Announcements. Class feedback for mid-course evaluations Receive  about survey to fill out until this Friday Announcements Project 2: Part 2a will be graded this week Part 2b take longer since we compare all graphs Project 3: Shared memory segments Linux: use shmget and shmat across server + client processes

More information

CS 318 Principles of Operating Systems

CS 318 Principles of Operating Systems CS 318 Principles of Operating Systems Fall 2018 Lecture 5: Thread Ryan Huang Slides adapted from Geoff Voelker s and David Mazières lectures Administrivia Lab 0 grading in progress Lab 1 review session

More information

CS140 Operating Systems and Systems Programming Midterm Exam

CS140 Operating Systems and Systems Programming Midterm Exam CS140 Operating Systems and Systems Programming Midterm Exam October 28 th, 2005 (Total time = 50 minutes, Total Points = 50) Name: (please print) In recognition of and in the spirit of the Stanford University

More information

Synchronization. CISC3595/5595 Fall 2015 Fordham Univ.

Synchronization. CISC3595/5595 Fall 2015 Fordham Univ. Synchronization CISC3595/5595 Fall 2015 Fordham Univ. Synchronization Motivation When threads concurrently read/write shared memory, program behavior is undefined Two threads write to the same variable;

More information

Embedded Systems: OS. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Embedded Systems: OS. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University Embedded Systems: OS Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Standalone Applications Often no OS involved One large loop Microcontroller-based

More information

CS 318 Principles of Operating Systems

CS 318 Principles of Operating Systems CS 318 Principles of Operating Systems Fall 2017 Midterm Review Ryan Huang 10/12/17 CS 318 Midterm Review 2 Midterm October 17 th Tuesday 9:00-10:20 am at classroom Covers material before virtual memory

More information

Systèmes d Exploitation Avancés

Systèmes d Exploitation Avancés Systèmes d Exploitation Avancés Instructor: Pablo Oliveira ISTY Instructor: Pablo Oliveira (ISTY) Systèmes d Exploitation Avancés 1 / 32 Review : Thread package API tid thread create (void (*fn) (void

More information

Introduction to the ThreadX Debugger Plugin for the IAR Embedded Workbench C-SPYDebugger

Introduction to the ThreadX Debugger Plugin for the IAR Embedded Workbench C-SPYDebugger C-SPY plugin Introduction to the ThreadX Debugger Plugin for the IAR Embedded Workbench C-SPYDebugger This document describes the IAR C-SPY Debugger plugin for the ThreadX RTOS. The ThreadX RTOS awareness

More information

Concurrency, Thread. Dongkun Shin, SKKU

Concurrency, Thread. Dongkun Shin, SKKU Concurrency, Thread 1 Thread Classic view a single point of execution within a program a single PC where instructions are being fetched from and executed), Multi-threaded program Has more than one point

More information

Embedded Systems: OS

Embedded Systems: OS Embedded Systems: OS Jinkyu Jeong (Jinkyu@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu ICE3028: Embedded Systems Design, Fall 2018, Jinkyu Jeong (jinkyu@skku.edu) Standalone

More information

AUTOBEST: A United AUTOSAR-OS And ARINC 653 Kernel. Alexander Züpke, Marc Bommert, Daniel Lohmann

AUTOBEST: A United AUTOSAR-OS And ARINC 653 Kernel. Alexander Züpke, Marc Bommert, Daniel Lohmann AUTOBEST: A United AUTOSAR-OS And ARINC 653 Kernel Alexander Züpke, Marc Bommert, Daniel Lohmann alexander.zuepke@hs-rm.de, marc.bommert@hs-rm.de, lohmann@cs.fau.de Motivation Automotive and Avionic industry

More information

Interrupts and Time. Real-Time Systems, Lecture 5. Martina Maggio 28 January Lund University, Department of Automatic Control

Interrupts and Time. Real-Time Systems, Lecture 5. Martina Maggio 28 January Lund University, Department of Automatic Control Interrupts and Time Real-Time Systems, Lecture 5 Martina Maggio 28 January 2016 Lund University, Department of Automatic Control Content [Real-Time Control System: Chapter 5] 1. Interrupts 2. Clock Interrupts

More information

Goals. Processes and Threads. Concurrency Issues. Concurrency. Interlacing Processes. Abstracting a Process

Goals. Processes and Threads. Concurrency Issues. Concurrency. Interlacing Processes. Abstracting a Process Goals Processes and Threads Process vs. Kernel Thread vs. User Green Threads Thread Cooperation Synchronization Implementing Concurrency Concurrency Uniprogramming: Execute one program at a time EX: MS/DOS,

More information

CS 153 Design of Operating Systems Winter 2016

CS 153 Design of Operating Systems Winter 2016 CS 153 Design of Operating Systems Winter 2016 Lecture 9: Semaphores and Monitors Some slides from Matt Welsh Summarize Where We Are Goal: Use mutual exclusion to protect critical sections of code that

More information

CS 153 Design of Operating Systems Winter 2016

CS 153 Design of Operating Systems Winter 2016 CS 153 Design of Operating Systems Winter 2016 Lecture 7: Synchronization Administrivia Homework 1 Due today by the end of day Hopefully you have started on project 1 by now? Kernel-level threads (preemptable

More information

Project 3-2. Mutex & CV

Project 3-2. Mutex & CV SSE3044 Introduction to Operating Systems Prof. Jinkyu Jeong Project 3-2. Mutex & CV 2018.05.30 (Wed.) TAs 이규선 (gyusun.lee@csl.skku.edu) / 안민우 (minwoo.ahn@csl.skku.edu) Project Plan Total 4 projects 1)

More information

Project-1 Discussion

Project-1 Discussion CSE 421/521 - Operating Systems Fall 2014 Lecture - VI Project-1 Discussion Tevfik Koşar University at Buffalo September 11 th, 2014 1 Pintos Projects 1. Threads

More information

CS162 Operating Systems and Systems Programming Midterm Review"

CS162 Operating Systems and Systems Programming Midterm Review CS162 Operating Systems and Systems Programming Midterm Review" March 5, 2012! http://inst.eecs.berkeley.edu/~cs162! Synchronization, Critical section" Midterm Review.2! Definitions" Synchronization: using

More information

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 8: Semaphores, Monitors, & Condition Variables

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 8: Semaphores, Monitors, & Condition Variables CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring 2004 Lecture 8: Semaphores, Monitors, & Condition Variables 8.0 Main Points: Definition of semaphores Example of use

More information

Pintos Project 2 User Programs

Pintos Project 2 User Programs 1 Pintos Project 2 User Programs COS 450 - Fall 2018 Project 1 Submissions Easy Things to Fix 2 Project submission Code style ASSERT and malloc() Design document questions Code Style 1.2.2.2 3 Match the

More information

Announcements. Reading. Project #1 due in 1 week at 5:00 pm Scheduling Chapter 6 (6 th ed) or Chapter 5 (8 th ed) CMSC 412 S14 (lect 5)

Announcements. Reading. Project #1 due in 1 week at 5:00 pm Scheduling Chapter 6 (6 th ed) or Chapter 5 (8 th ed) CMSC 412 S14 (lect 5) Announcements Reading Project #1 due in 1 week at 5:00 pm Scheduling Chapter 6 (6 th ed) or Chapter 5 (8 th ed) 1 Relationship between Kernel mod and User Mode User Process Kernel System Calls User Process

More information

What's wrong with Semaphores?

What's wrong with Semaphores? Next: Monitors and Condition Variables What is wrong with semaphores? Monitors What are they? How do we implement monitors? Two types of monitors: Mesa and Hoare Compare semaphore and monitors Lecture

More information

Operating Systems. Lab. Class Week 14

Operating Systems. Lab. Class Week 14 Operating Systems Lab. Class Week 14 Project Plan 6 projects 0. Install xv6 1. System call 2. Scheduling 3. Virtual memory 1 4. Virtual memory 2 5. Concurrency 1 6. Concurrency 2 Individual projects 2016-06-01

More information

System Call. Preview. System Call. System Call. System Call 9/7/2018

System Call. Preview. System Call. System Call. System Call 9/7/2018 Preview Operating System Structure Monolithic Layered System Microkernel Virtual Machine Process Management Process Models Process Creation Process Termination Process State Process Implementation Operating

More information

Last Class: Synchronization. Review. Semaphores. Today: Semaphores. MLFQ CPU scheduler. What is test & set?

Last Class: Synchronization. Review. Semaphores. Today: Semaphores. MLFQ CPU scheduler. What is test & set? Last Class: Synchronization Review Synchronization Mutual exclusion Critical sections Example: Too Much Milk Locks Synchronization primitives are required to ensure that only one thread executes in a critical

More information

TDDB68 Lesson 3. Simon Ståhlberg

TDDB68 Lesson 3. Simon Ståhlberg TDDB68 Lesson 3 Simon Ståhlberg Contents Overview of lab 3 A: Exec, wait, exit B: Program arguments C: Termination of ill-behaving user processes Testing your implementation Overview of lab 4 File system

More information

Midterm Exam March 13, 2013 CS162 Operating Systems

Midterm Exam March 13, 2013 CS162 Operating Systems University of California, Berkeley College of Engineering Computer Science Division EECS Spring 2013 Anthony D. Joseph Midterm Exam March 13, 2013 CS162 Operating Systems Your Name: SID AND 162 Login:

More information

February 23 rd, 2015 Prof. John Kubiatowicz

February 23 rd, 2015 Prof. John Kubiatowicz CS162 Operating Systems and Systems Programming Lecture 9 Synchronization Continued, Readers/Writers example, Scheduling February 23 rd, 2015 Prof. John Kubiatowicz http://cs162.eecs.berkeley.edu Acknowledgments:

More information

Project 4: Virtual Memory

Project 4: Virtual Memory Project 4: Virtual Memory by Ben Pfaff USF modifications by Greg Benson Chapter 1: Project 4: Virtual Memory 1 1 Project 4: Virtual Memory By now you should be familiar with the inner workings of Pintos.

More information

Interrupts and Time. Interrupts. Content. Real-Time Systems, Lecture 5. External Communication. Interrupts. Interrupts

Interrupts and Time. Interrupts. Content. Real-Time Systems, Lecture 5. External Communication. Interrupts. Interrupts Content Interrupts and Time Real-Time Systems, Lecture 5 [Real-Time Control System: Chapter 5] 1. Interrupts 2. Clock Interrupts Martina Maggio 25 January 2017 Lund University, Department of Automatic

More information

Timers 1 / 46. Jiffies. Potent and Evil Magic

Timers 1 / 46. Jiffies. Potent and Evil Magic Timers 1 / 46 Jiffies Each timer tick, a variable called jiffies is incremented It is thus (roughly) the number of HZ since system boot A 32-bit counter incremented at 1000 Hz wraps around in about 50

More information

CS 140 Project 2: User Programs. Fall 2015

CS 140 Project 2: User Programs. Fall 2015 CS 140 Project 2: User Programs Fall 2015 Important Dates Project 1: DUE TODAY (Friday, October 9 th ) at 12pm Project 2 will be due Friday, October 23 rd at 12pm 2 weeks Start early J 2 Overview Project

More information

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017 CS 471 Operating Systems Yue Cheng George Mason University Fall 2017 1 Review: Sync Terminology Worksheet 2 Review: Semaphores 3 Semaphores o Motivation: Avoid busy waiting by blocking a process execution

More information

., --t - QJ. ., n. - r-+ r- (v. ::r. !:t. ... c.. c.. V> c.. c.. ::J ::J ::J. ~ ::::s. ::::s \I\ ([) QJ (D -. l/')

., --t - QJ. ., n. - r-+ r- (v. ::r. !:t. ... c.. c.. V> c.. c.. ::J ::J ::J. ~ ::::s. ::::s \I\ ([) QJ (D -. l/') ,,., --t - 0 c.. c.. V> QJ < QJ < < ::J., n ([) 0 QJ ::::s c.. c.. (D -..,...!:!.., - r-+ ~ ::::s n ::r... 0 ::J 0 - C Synchronization

More information

Real-Time Systems Hermann Härtig Real-Time Operating Systems Brief Overview

Real-Time Systems Hermann Härtig Real-Time Operating Systems Brief Overview Real-Time Systems Hermann Härtig Real-Time Operating Systems Brief Overview 02/02/12 Outline Introduction Basic variants of RTOSes Real-Time paradigms Common requirements for all RTOSes High level resources

More information

Project 2: User Programs

Project 2: User Programs Project 2: User Programs Presented by Jaishankar Sundararaman 21 February 2008 Till now All code part of Pintos Kernel Code compiled directly with the kernel This required that the tests call some functions

More information

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring 2004

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring 2004 CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring 2004 Lecture 9: Readers-Writers and Language Support for Synchronization 9.1.2 Constraints 1. Readers can access database

More information

Implementation of the ART Real Time Micro Kernel

Implementation of the ART Real Time Micro Kernel Implementation of the ART Real Time Micro Kernel This document describes the functions constituting the application interface of the ART kernel. Task administration exception init_kernel() This function

More information

TDDB68. Lesson 1. Simon Ståhlberg

TDDB68. Lesson 1. Simon Ståhlberg TDDB68 Lesson 1 Simon Ståhlberg Contents General information about the labs Overview of the labs Memory layout of C programs ("Lab 00") General information about Pintos System calls Lab 1 Debugging Administration

More information

UNIX rewritten using C (Dennis Ritchie) UNIX (v7) released (ancestor of most UNIXs).

UNIX rewritten using C (Dennis Ritchie) UNIX (v7) released (ancestor of most UNIXs). UNIX: HISTORY: 1. 1969 UNIX developed (Ken Thompson). 2. 1972 UNIX rewritten using C (Dennis Ritchie). 3. 1976 UNIX (v6) released for commercial use. 4. 1978 UNIX (v7) released (ancestor of most UNIXs).

More information

Multiprocessor and Real- Time Scheduling. Chapter 10

Multiprocessor and Real- Time Scheduling. Chapter 10 Multiprocessor and Real- Time Scheduling Chapter 10 Classifications of Multiprocessor Loosely coupled multiprocessor each processor has its own memory and I/O channels Functionally specialized processors

More information

Synchronization 1. Synchronization

Synchronization 1. Synchronization Synchronization 1 Synchronization key concepts critical sections, mutual exclusion, test-and-set, spinlocks, blocking and blocking locks, semaphores, condition variables, deadlocks reading Three Easy Pieces:

More information

TDDB68 Lesson 2 Pintos Assignments 3 & 4. Mattias Eriksson 2010 (or

TDDB68 Lesson 2 Pintos Assignments 3 & 4. Mattias Eriksson 2010 (or TDDB68 Lesson 2 Pintos Assignments 3 & 4 Mattias Eriksson 2010 mater@ida.liu.se (or mattias.eriksson@liu.se) some slides by Viacheslav Izosimov 2007-2008 Instead of Motivation Plan for something like this:

More information

Synchronization. CS61, Lecture 18. Prof. Stephen Chong November 3, 2011

Synchronization. CS61, Lecture 18. Prof. Stephen Chong November 3, 2011 Synchronization CS61, Lecture 18 Prof. Stephen Chong November 3, 2011 Announcements Assignment 5 Tell us your group by Sunday Nov 6 Due Thursday Nov 17 Talks of interest in next two days Towards Predictable,

More information

AC OB S. Multi-threaded FW framework (OS) for embedded ARM systems Torsten Jaekel, June 2014

AC OB S. Multi-threaded FW framework (OS) for embedded ARM systems Torsten Jaekel, June 2014 AC OB S Multi-threaded FW framework (OS) for embedded ARM systems Torsten Jaekel, June 2014 ACOBS ACtive OBject (operating) System Simplified FW System for Multi-Threading on ARM embedded systems ACOBS

More information

FreeRTOS X. Task Notifications Semaphores Family Critical Section FreeRTOS Producer Consumer Tasks

FreeRTOS X. Task Notifications Semaphores Family Critical Section FreeRTOS Producer Consumer Tasks FreeRTOS X Task Notifications Semaphores Family Critical Section FreeRTOS Producer Consumer Tasks Task Notifications Semaphores Family Binary Semaphore Counting Semaphore Mutex Recursive Mutex Critical

More information

Concurrency and Synchronisation

Concurrency and Synchronisation Concurrency and Synchronisation 1 Sections 2.3 & 2.4 Textbook 2 Making Single-Threaded Code Multithreaded Conflicts between threads over the use of a global variable 3 Inter- Thread and Process Communication

More information

STUDENT NAME: STUDENT ID: Problem 1 Problem 2 Problem 3 Problem 4 Problem 5 Total

STUDENT NAME: STUDENT ID: Problem 1 Problem 2 Problem 3 Problem 4 Problem 5 Total University of Minnesota Department of Computer Science & Engineering CSci 5103 - Fall 2018 (Instructor: Tripathi) Midterm Exam 1 Date: October 18, 2018 (1:00 2:15 pm) (Time: 75 minutes) Total Points 100

More information

CSCI 350 Ch. 5 Synchronization. Mark Redekopp Michael Shindler & Ramesh Govindan

CSCI 350 Ch. 5 Synchronization. Mark Redekopp Michael Shindler & Ramesh Govindan 1 CSCI 350 Ch. 5 Synchronization Mark Redekopp Michael Shindler & Ramesh Govindan 2 RACE CONDITIONS AND ATOMIC OPERATIONS 3 Race Condition A race condition occurs when the behavior of the program depends

More information

( D ) 4. Which is not able to solve the race condition? (A) Test and Set Lock (B) Semaphore (C) Monitor (D) Shared memory

( D ) 4. Which is not able to solve the race condition? (A) Test and Set Lock (B) Semaphore (C) Monitor (D) Shared memory CS 540 - Operating Systems - Final Exam - Name: Date: Wenesday, May 12, 2004 Part 1: (78 points - 3 points for each problem) ( C ) 1. In UNIX a utility which reads commands from a terminal is called: (A)

More information

A Predictable RTOS. Mantis Cheng Department of Computer Science University of Victoria

A Predictable RTOS. Mantis Cheng Department of Computer Science University of Victoria A Predictable RTOS Mantis Cheng Department of Computer Science University of Victoria Outline I. Analysis of Timeliness Requirements II. Analysis of IO Requirements III. Time in Scheduling IV. IO in Scheduling

More information

537 Final Exam, Old School Style. "The Job Interview" Name: This exam contains 13 old-school pages.

537 Final Exam, Old School Style. The Job Interview Name: This exam contains 13 old-school pages. 537 Final Exam, Old School Style "The Job Interview" Name: This exam contains 13 old-school pages. THE JOB INTERVIEW (page 2) You are on a job interview. Unfortunately, on job interviews like this one,

More information