Week 3 January 22, 2004 Adrienne Noble. Today CVS – a great tool to use with your groups Threads – basic thread operations Intro to synchronization Hand.

Slides:



Advertisements
Similar presentations
Operating Systems Semaphores II
Advertisements

Operating Systems ECE344 Midterm review Ding Yuan
Bilgisayar Mühendisliği Bölümü GYTE - Bilgisayar Mühendisliği Bölümü Multithreading the SunOS Kernel J. R. Eykholt, S. R. Kleiman, S. Barton, R. Faulkner,
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,
1 CSE451 Section 3. 2 Reminders Start project 2! It’s long Read the assignment carefully Read it again Project 2 will be done in groups of 3 Today: Form.
Using subversion COMP 2400 Prof. Chris GauthierDickey.
1 CS318 Project #3 Preemptive Kernel. 2 Continuing from Project 2 Project 2 involved: Context Switch Stack Manipulation Saving State Moving between threads,
5.6 Semaphores Semaphores –Software construct that can be used to enforce mutual exclusion –Contains a protected variable Can be accessed only via wait.
1 Reminders Start project 2! It’s long Read the assignment carefully Read it again Project 2 will be done in groups of 3 groups to me Part 1 due.
1 Reminders Start project 2! It’s long Read the assignment carefully Read it again Make sure your groups are correct Today: Project 2 intro CVS.
1 Chapter 4 Threads Threads: Resource ownership and execution.
CPS110: Implementing threads/locks on a uni-processor Landon Cox.
Intro to OS CUCS Mossé Processes and Threads What is a process? What is a thread? What types? A program has one or more locus of execution. Each execution.
G51FSE Version Control Naisan Benatar. Lecture 5 - Version Control 2 On today’s menu... The problems with lots of code and lots of people Version control.
SubVersioN – the new Central Service at DESY by Marian Gawron.
Source Code Revision Control Software CVS and Subversion (svn)
Chapter 51 Threads Chapter 5. 2 Process Characteristics  Concept of Process has two facets.  A Process is: A Unit of resource ownership:  a virtual.
CSE 451: Operating Systems Autumn 2013 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Operating Systems CSE 411 CPU Management Sept Lecture 11 Instructor: Bhuvan Urgaonkar.
1 Lecture 4: Threads Operating System Fall Contents Overview: Processes & Threads Benefits of Threads Thread State and Operations User Thread.
Introduction to Processes CS Intoduction to Operating Systems.
Chris Onions Getting started with CVS in ATLAS 11 Getting started with CVS in ATLAS Chris Onions (Tutorial based on that of Raúl Ramos Pollán CERN / IT.
CSE451 NT Synchronization Autumn 2002 Gary Kimura Lecture #9 October 18, 2002.
Operating Systems Lecture 7 OS Potpourri Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software.
Games Development 2 Concurrent Programming CO3301 Week 9.
CS 346 – Chapter 4 Threads –How they differ from processes –Definition, purpose Threads of the same process share: code, data, open files –Types –Support.
Project 2 kthreads, concurrency, shuttle. Highlevel overview User space –program wants to control the shuttle simulation by sending requests. –start_shuttle()
CPS110: Implementing threads Landon Cox. Recap and looking ahead Hardware OS Applications Where we’ve been Where we’re going.
WinCvs. WinCVS WinCvs is a window based version control system. Use WinCvs when  You want to save every version of your file you have ever created. CVS.
Operating Systems CSE 411 CPU Management Sept Lecture 10 Instructor: Bhuvan Urgaonkar.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
1 Condition Variables CS 241 Prof. Brighten Godfrey March 16, 2012 University of Illinois.
12 CVS Mauro Jaskelioff (originally by Gail Hopkins)
13-1 Chapter 13 Concurrency Topics Introduction Introduction to Subprogram-Level Concurrency Semaphores Monitors Message Passing Java Threads C# Threads.
Version Control System
CSE 153 Design of Operating Systems Winter 2015 Midterm Review.
Threads. Readings r Silberschatz et al : Chapter 4.
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.
1 Why Threads are a Bad Idea (for most purposes) based on a presentation by John Ousterhout Sun Microsystems Laboratories Threads!
Implementing Lock. From the Previous Lecture  The “too much milk” example shows that writing concurrent programs directly with load and store instructions.
CPS110: Implementing threads on a uni-processor Landon Cox January 29, 2008.
Threads prepared and instructed by Shmuel Wimer Eng. Faculty, Bar-Ilan University 1July 2016Processes.
Tutorial 2: Homework 1 and Project 1
Chapter 4 – Thread Concepts
CS703 - Advanced Operating Systems
Process Management Process Concept Why only the global variables?
COT 4600 Operating Systems Fall 2009
January 29, 2004 Adrienne Noble
Chapter 4 – Thread Concepts
Chapter 4 Threads.
Reminders Form groups of 3 by tomorrow Start project 2! Today:
ICS 143 Principles of Operating Systems
Lecture 10: Threads Implementation
CSE 451: Operating Systems Spring 2012 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Lecture Topics: 11/1 General Operating System Concepts Processes
Lecture 2 Part 2 Process Synchronization
CSE 451 Autumn 2003 Section 3 October 16.
Implementing Mutual Exclusion
Threads Chapter 5 2/17/2019 B.Ramamurthy.
Threads Chapter 5 2/23/2019 B.Ramamurthy.
Still Chapter 2 (Based on Silberchatz’s text and Nachos Roadmap.)
February 5, 2004 Adrienne Noble
Lecture 10: Threads Implementation
CS510 Operating System Foundations
CSE 153 Design of Operating Systems Winter 19
January 15, 2004 Adrienne Noble
CSE 451 Section 1/27/2000.
CSE 153 Design of Operating Systems Winter 2019
Threads CSE 2431: Introduction to Operating Systems
CS Introduction to Operating Systems
Presentation transcript:

Week 3 January 22, 2004 Adrienne Noble

Today CVS – a great tool to use with your groups Threads – basic thread operations Intro to synchronization Hand back Project 1

Questions? Lecture Homework 3 – Due Wed, Jan 28 Project 2 – Due Mon, Feb 2 Everyone should be signed up for a group by now

Why use CVS? The other way: Keep every version of code, all with different names: Project2good Project2_1_22_04 Project2working adrienneProject2_Feb_2 Project_old Send s back and forth with new changes Merge different versions by hand The CVS way: One version, saved in the CVS repository Multiple people can work on the same file concurrently CVS merges the edited versions together as you put them back in the repository

Setting up CVS Set up CVS root Export CVSROOT=/cse451/groupa/ Initialize a repository cvs init Add your files cd into the directory of files you want to add cvs import –m “initial code” project2 vendor release

CVS Commands cvs checkout Checks out the module into your current directory cvs update [files…] Updates your checked out module by merging it with new changes cvs commit [files…] Saves your edited files in the repository cvs add [files…] Adds a new file to the repository More info at

What is a thread? Often called a lightweight process Shares many resources with the process Code, heap, etc But has it’s own stack, program counter, and registers Much less expensive to create and switch between than processes

Kernel Threads Kernel schedules and runs threads Usually scheduled like any other process Must switch into kernel mode for every context switch

User Threads Run completely in user space within one process Can make them faster than kernel threads Lets programmer have more flexibility in scheduling

Basic Thread Operations init() create( ) exit() yield() struct _thread { }

Synchronization What does synchronization do? Why do we need it?

Mutexes, Semaphores, Condition Variables, Monitors… Lots of names for things that do very similar things The goal is to protect shared data from being accessed by more than one thread at once They just have different features Each has advantages and disadvantages in different situations

Mutex (lock) Only allows one thread to access the shared data at a time Two functions: lock and unlock Basic Idea: Get lock (call lock function) Access shared data Give up lock (call unlock function)

Mutex Examples Withdrawing money from a bank account Reserving a concert ticket

Condition Variables Lets a thread wait for a certain condition or event to occur while holding a mutex Two functions: wait and signal Basic Idea: Thread with the lock calls wait The thread gives up the lock, then goes to sleep on the condition variable’s queue Someone calls signal to say that the event or condition has occurred A thread wakes up from the queue, obtains the lock again, and then continues

Project 1 Spend some time on the write up Error checking is important chdir, fork, execvp, your syscall, copy_to_user Read directions carefully Turn in the correct stuff in the correct format