Homework Assignment #2 J. H. Wang Nov. 1, 2013.

Slides:



Advertisements
Similar presentations
1 Interprocess Communication 1. Ways of passing information 2. Guarded critical activities (e.g. updating shared data) 3. Proper sequencing in case of.
Advertisements

3.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Process An operating system executes a variety of programs: Batch system.
1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
Operating Systems Mehdi Naghavi Winter 1385.
CS Lecture 4 Programming with Posix Threads and Java Threads George Mason University Fall 2009.
CSEN5322 Quiz-5.
Chapter 2 Processes and Threads
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
1 Chapter 5 Threads 2 Contents  Overview  Benefits  User and Kernel Threads  Multithreading Models  Solaris 2 Threads  Java Threads.
Cpr E 308 Spring 2004 Recap for Midterm Introductory Material What belongs in the OS, what doesn’t? Basic Understanding of Hardware, Memory Hierarchy.
1 Threads CSCE 351: Operating System Kernels Witawas Srisa-an Chapter 4-5.
Avishai Wool lecture Introduction to Systems Programming Lecture 4 Inter-Process / Inter-Thread Communication.
1 CS318 Project #3 Preemptive Kernel. 2 Continuing from Project 2 Project 2 involved: Context Switch Stack Manipulation Saving State Moving between threads,
Concurrency: Deadlock and Starvation Chapter 6. Revision Describe three necessary conditions for deadlock Which condition is the result of the three necessary.
1 Concurrency: Deadlock and Starvation Chapter 6.
Threads Chapter 4. Modern Process & Thread –Process is an infrastructure in which execution takes place  (address space + resources) –Thread is a program.
Fundamentals of Python: From First Programs Through Data Structures
More Synchronisation Last time: bounded buffer, readers-writers, dining philosophers Today: sleeping barber, monitors.
1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
Multithreaded Web Server.
CS 149: Operating Systems February 17 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
Multithreading Allows application to split itself into multiple “threads” of execution (“threads of execution”). OS support for creating threads, terminating.
Process Management. Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication.
The University of Adelaide, School of Computer Science
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 2 Processes and Threads Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
1 Confidential Enterprise Solutions Group Process and Threads.
Chapter 1 Computer System Overview Sections 1.1 to 1.6 Instruction exe cution Interrupt Memory hierarchy Cache memory Locality: spatial and temporal Problem.
Homework Assignment #1 J. H. Wang Oct. 2, 2015.
Thread Synchronization Tutorial #8 CPSC 261. A thread is a virtual processor Each thread is provided the illusion that it owns a core – Copy of the registers.
Homework Assignment #1 J. H. Wang Oct. 13, Homework #1 Chap.1: 1.24 Chap.2: 2.13 Chap.3: 3.5, 3.13* (or 3.14*) Chap.4: 4.6, 4.12* –(*: optional.
Homework Assignment #2 J. H. Wang Oct. 17, 2007.
Homework Assignment #1 J. H. Wang Oct. 6, 2011.
Chapter 4: Threads. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 4: Threads Overview Multithreading Models Threading Issues.
Chapter 4: Threads. 2 Overview Multithreading Models Threading Issues Pthreads Windows XP Threads Linux Threads.
Professor: Shu-Ching Chen TA: Samira Pouyanfar.  An independent stream of instructions that can be scheduled to run  A path of execution int a, b; int.
Multithreading Chapter Introduction Consider ability of human body to ___________ –Breathing, heartbeat, chew gum, walk … In many situations we.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 4: Threads.
Operating Systems Inter-Process Communications. Lunch time in the Philosophy Department. Dining Philosophers Problem (1)
Homework Assignment #3 J. H. Wang Nov. 13, 2015.
Homework Assignment #2 J. H. Wang Nov. 1, Homework #2 Chap.5: 5.8, 5.19, 5.22 Chap.6: 6.11, 6.12, *6.35 (Optional: End-of-chapter project for Chap.
Homework Assignment #1 J. H. Wang Oct. 11, 2013.
Practice Chapter Five.
Operating Systems COMP 4850/CISG 5550 Interprocess Communication, Part II Dr. James Money.
Homework Assignment #1 J. H. Wang Sep. 22, Homework #1 Chap.2: 2.10 Chap.3: 3.1, 3.4, 3.5* (or 3.6*) Chap.4: 4.6, 4.8* (Optional: End-of-chapter.
Dining Philosophers & Monitors Questions answered in this lecture: How to synchronize dining philosophers? What are monitors and condition variables? What.
1 Processes and Threads Part II Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
操作系统原理 OPERATING SYSTEM Chapter 2 Processes and Threads 进程与线程.
Lecture 5. Example for periority The average waiting time : = 41/5= 8.2.
Homework Assignment #2 J. H. Wang Oct. 25, 2016.
Process Synchronization
Practice Chapter Four.
Homework Assignment #2 J. H. Wang Oct. 24, 2017.
Chapter 5: Threads Overview Multithreading Models Threading Issues
Process Management Presented By Aditya Gupta Assistant Professor
Multithreading Tutorial
Lecture 16: Readers-Writers Problem and Message Passing
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Lecture 15: Dining Philosophers Problem
Sarah Diesburg Operating Systems COP 4610
Threads Chapter 4.
CSE 451 Autumn 2003 Section 3 October 16.
Major Topics in Operating Systems
Operating Systems Threads 1.
Lecture 16: Readers-Writers Problem and Message Passing
Lecture 15: Dining Philosophers Problem
Q:(a)Describe the action for a kernel to context switching for threads (b)why it is faster than processes?
Chapter 7: Synchronization Examples
CMPE 135: Object-Oriented Analysis and Design April 30 Class Meeting
CS 144 Advanced C++ Programming May 7 Class Meeting
CS Introduction to Operating Systems
Presentation transcript:

Homework Assignment #2 J. H. Wang Nov. 1, 2013

Homework #2 Chap.4: 4.2, 4.19* Chap.5: 5.8, 5.19, 5.22 (Optional: End-of-chapter project for Chap. 4 & 6) Due: two weeks (Nov. 15, 2013)

Chap. 4 4.2: Under what circumstances does a multithreaded solution using multiple kernel threads provide better performance than a single-threaded solution on a single-processor system?

4. 19. : Write a multithreaded program that outputs prime numbers 4.19*: Write a multithreaded program that outputs prime numbers. This program should work as follows: The user will run the program and will enter a number on the command line. The program will then create a separate thread that outputs all the prime numbers less than or equal to the number entered by the user.

Optional End-of-Chapter Programming Projects Programming Project for Chap. 4: 1. Sudoku solution validator Passing parameters to each thread Returning results to the parent thread 2. Multithreaded sorting application

Optional End-of-Chapter Programming Projects Programming Projects for Chap. 6: Project 1: The Sleeping Teaching Assistant Room: 1 desk with a chair and computer Hallway: 3 chairs POSIX threads, mutex locks, and semaphores Project 2: The Dining Philosophers Problem Pthread mutex locks and condition variables Project 3: Producer-Consumer Problem Producer and consumer threads Pthreads mutex locks/semaphores Windows mutex locks/semaphores

Any Question or Comments?