Project 2 Non-Preemptive Scheduling

Slides:



Advertisements
Similar presentations
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Advertisements

Tutorial 4 Scheduling. Why do we need scheduling? To manage processes according to requirements of a system, like: –User responsiveness or –Throughput.
Threads Irfan Khan Myo Thein What Are Threads ? a light, fine, string like length of material made up of two or more fibers or strands of spun cotton,
09/30/04 Assignment 2 Non-preemptive scheduling COS Operating System Fall 2004.
1 CS318 Project #3 Preemptive Kernel. 2 Continuing from Project 2 Project 2 involved: Context Switch Stack Manipulation Saving State Moving between threads,
Ceng Operating Systems Chapter 2.1 : Processes Process concept Process scheduling Interprocess communication Deadlocks Threads.
Operating Systems Processes (Ch 4.1). Processes “A program in execution” Modern computers allow several at once –“pseudoparallelism” A B C Program Counter.
Process Concept An operating system executes a variety of programs
Process by Dr. Amin Danial Asham. References Operating System Concepts ABRAHAM SILBERSCHATZ, PETER BAER GALVIN, and GREG GAGNE.
MicroC/OS-II Embedded Systems Design and Implementation.
Threads Many software packages are multi-threaded Web browser: one thread display images, another thread retrieves data from the network Word processor:
Multiprogramming CSE451 Andrew Whitaker. Overview Multiprogramming: Running multiple programs “at the same time”  Requires multiplexing (sharing) the.
Processes and Threads CS550 Operating Systems. Processes and Threads These exist only at execution time They have fast state changes -> in memory and.
1 RTOS Design Some of the content of this set of slides is taken from the documentation existing on the FreeRTOS website
Processes & Threads Bahareh Goodarzi. Single & Multiple Thread of control code files data code files data.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Thread Scheduling.
1 Chapter 2.1 : Processes Process concept Process concept Process scheduling Process scheduling Interprocess communication Interprocess communication Threads.
Multiprogramming. Readings r Silberschatz, Galvin, Gagne, “Operating System Concepts”, 8 th edition: Chapter 3.1, 3.2.
Nachos Instructional OS CS 270, Tao Yang, Spring 2011.
Computer Studies (AL) Operating System Process Management - Process.
The act of Scheduling a process means changing the active PCB pointed to by the CPU. Also called a context switch. A context switch is essentially the.
Processes and Process Control 1. Processes and Process Control 2. Definitions of a Process 3. Systems state vs. Process State 4. A 2 State Process Model.
Java Thread and Memory Model
Operating Systems CSE 411 CPU Management Sept Lecture 10 Instructor: Bhuvan Urgaonkar.
COT 4600 Operating Systems Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:00-4:00 PM.
Managing Processors Jeff Chase Duke University. The story so far: protected CPU mode user mode kernel mode kernel “top half” kernel “bottom half” (interrupt.
Cs431-cotter1 Processes and Threads Tanenbaum 2.1, 2.2 Crowley Chapters 3, 5 Stallings Chapter 3, 4 Silberschaz & Galvin 3, 4.
Multiprogramming. Readings r Chapter 2.1 of the textbook.
Processes and threads.
Copyright ©: Nahrstedt, Angrave, Abdelzaher
Advanced Operating Systems CIS 720
Process Management Process Concept Why only the global variables?
CS 6560: Operating Systems Design
Sujata Ray Dey Maheshtala College Computer Science Department
Practice Chapter Four.
Processes and Threads Processes and their scheduling
OPERATING SYSTEMS CS3502 Fall 2017
Threads and Scheduling
Chapter 2 Processes and Threads Today 2.1 Processes 2.2 Threads
Day 08 Processes.
Day 09 Processes.
Section 10: Last section! Final review.
CPU scheduling 6. Schedulers, CPU Scheduling 6.1. Schedulers
Intro to Processes CSSE 332 Operating Systems
IS310 Hardware & Network Infrastructure Ronny L
Process Virtualization. Process Process is a program that has initiated its execution. A program is a passive entity; whereas a process is an active entity.
Process management Information maintained by OS for process management
Lecture 11: Mutual Exclusion
ICS 143 Principles of Operating Systems
ICS Principles of Operating Systems
Mid Term review CSC345.
Process Description and Control
Process Description and Control
CSE 451: Operating Systems Autumn 2003 Lecture 5 Threads
Lecture 2 Part 2 Process Synchronization
Operating Systems Processes (Ch 4.1).
CSE 451: Operating Systems Winter 2003 Lecture 5 Threads
Sujata Ray Dey Maheshtala College Computer Science Department
Threads Chapter 5 2/17/2019 B.Ramamurthy.
EE 472 – Embedded Systems Dr. Shwetak Patel.
Threads Chapter 5 2/23/2019 B.Ramamurthy.
Presented by: SHILPI AGARWAL
Still Chapter 2 (Based on Silberchatz’s text and Nachos Roadmap.)
October 9, 2002 Gary Kimura Lecture #5 October 9, 2002
Lecture 11: Mutual Exclusion
CS333 Intro to Operating Systems
Processes and Process Table
CSE 153 Design of Operating Systems Winter 2019
CSE 451: Operating Systems Winter 2001 Lecture 5 Threads
Threads CSE 2431: Introduction to Operating Systems
Presentation transcript:

Project 2 Non-Preemptive Scheduling COS 318

General Suggestions Use an IDE Eclipse Built into lab machines Help -> Install New Software... Download a specific Eclipse package for C/C++ from eclipse.org Others Start as soon as you can and get as much done as possible by design review time bochsdbg / bochs-gdb

Good News No more segments!

Overview Add multiprogramming to the kernel Non-preemptive scheduler 5 threads, 3 processes Process Control Blocks Context switching Timing Mutual exclusion Lock

Non-Preemptive What does it mean? yield & exit do_yield() & do_exit() within the kernel (kernel threads can call these directly) yield() & exit() for processes dispatches a desire to call do_yield() or do_exit() to the kernel

Non-Preemptive Scheduling Example COS 318 goToClass(); goToPrecept(); yield(); coding(); designReview(); exit(); Life haveFun(); yield(); play(); work(); hangout(); ... Brain

What yield’ing does When yield is called, the “context” of a task (thread or process) must be saved Process Control Block What does it contain? eflags (pushfl, popfl) Will be done in assembly Once the context is saved, the scheduler is run to pick a new task

Picking a New Task All tasks are waiting in queue Pick the next one from the front of the ready queue Restore it’s state from the PCB ret to where the task was executing before

caller-saved registers cdecl callee-saved registers X X call ret caller-saved registers http://www.cs.virginia.edu/~evans/cs216/guides/x86.html

Why not just use jmp?

Mutual Exclusion Only one lock used by threads lock_init(lock_t * l) lock_acquire(lock_t * l) lock_release(lock_t * l)