CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r Email:...

18
CS 3305 Course Overview

Transcript of CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r Email:...

Page 1: CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r Email: hanan at csd dot uwo ca r Office Hours: m Drop-by m Appointment.

CS 3305 Course Overview

Page 2: CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r Email: hanan at csd dot uwo ca r Office Hours: m Drop-by m Appointment.

Introduction

Instructor: Dr Hanan Lutfiyya Office: MC 355 Email: hanan at csd dot uwo ca Office Hours:

Drop-by Appointment Specific office hours will be posted the week

that an assignment is due

Page 3: CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r Email: hanan at csd dot uwo ca r Office Hours: m Drop-by m Appointment.

Course Topics

Course is about what lies under the command line prompts in Linix or the GUI in Windows/MAC.

We will discuss: Operating systems organized Process scheduling Process coordination Memory management File systems “hot topics” (time permitting)

Page 4: CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r Email: hanan at csd dot uwo ca r Office Hours: m Drop-by m Appointment.

Course Logistics

CS3305 Textbook: Operating System Concepts – 8th Edition Silberschatz, Galvin, and Cagne, Addison-Wesley Inc. (5th-7th editions, 9 edition and Java Versions are fine as

well).

Lectures Notes Made available on the course website

Page 5: CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r Email: hanan at csd dot uwo ca r Office Hours: m Drop-by m Appointment.

Course Evaluation

Evaluation 1 midterm, 1 final 4 assignments

There is a heavy programming component based on C/C++ language

Grading is results based i.e., Evaluation is based on an “acceptance test”.

Page 6: CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r Email: hanan at csd dot uwo ca r Office Hours: m Drop-by m Appointment.

Late Policies and Coupons Late Penalties

5 marks a day Saturday and Sunday count as one day Assignments more than 5 days will not be

accepted Late Coupons

Three “late coupons” A coupon gives you a one-day assignment

extension Cannot be used for bonus marks or used

retroactively

Page 7: CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r Email: hanan at csd dot uwo ca r Office Hours: m Drop-by m Appointment.

Assignment Overview (Tentative)

Shell Linux – add a system call Threading Memory Management

Page 8: CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r Email: hanan at csd dot uwo ca r Office Hours: m Drop-by m Appointment.

Why Study Operating Systems?

I probably will not write one from scratch

I have been writing Java (or C or Python) programs and I didn’t need to know anything about how the OS works

All I need to know are the commands I should submit to the OS to get my program to run or to store my data in a file.

Page 9: CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r Email: hanan at csd dot uwo ca r Office Hours: m Drop-by m Appointment.

Why Study Operating Systems?

Understanding how operating systems manage CPU, memory can help you be a better programmer.

Example Structuring a loop Web servers

Page 10: CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r Email: hanan at csd dot uwo ca r Office Hours: m Drop-by m Appointment.

OS and Loops

Consider the following code segments:

int data[128][128];for (j = 0; j <128; j++) for (i = 0; i < 128;i++)

data[i,j] = 0;

Does it matter which you use?

int data[128][128];for (i = 0; i <128; i++) for (j = 0; j < 128;j++)

data[i,j] = 0;

Page 11: CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r Email: hanan at csd dot uwo ca r Office Hours: m Drop-by m Appointment.

OS and Loops

Reasoning for answer No? The code segments execute the same number of instructions.

The correct answer: Yes it does matter One will give you much faster results. The reason has to do with the way the OS

manages its memory

Page 12: CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r Email: hanan at csd dot uwo ca r Office Hours: m Drop-by m Appointment.

OS and Request Processing Application: Withdraw money from a

bank account Two requests for withdrawal from the

same account comes to a bank from two different ATMs

A thread for each request is created A thread is a unit of execution The same program (on the next page is

executed)

Page 13: CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r Email: hanan at csd dot uwo ca r Office Hours: m Drop-by m Appointment.

OS and Request Processing

int withdraw(account, amount){ balance = get_balance(account); balance = balance – amount; put_balance(account, balance) return balance}

What happens if both requests request that $1000 be withdrawn from the same account?

Assume that the account currently has $1000

Page 14: CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r Email: hanan at csd dot uwo ca r Office Hours: m Drop-by m Appointment.

OS and Request Processing

Both threads will read a balance of $1000 Both threads will allow for $1000 to be withdrawn

balance = get_balance(account) balance = balance – amount 1;

balance=get_balance(account); balance = balance – amount;put_balance(account,balance)

put_balance(account,balance);

Executionsequencess seen byCPU

Thread 1

Thread 2

Thread 1

Switch to Thread 2

Switch to Thread 1

Page 15: CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r Email: hanan at csd dot uwo ca r Office Hours: m Drop-by m Appointment.

Why Study Operating Systems? You may object to this example

Why are two requests taking turns using the CPU?

A request comes in, should get executed before the next request

If you did this it would very slow Why? Well you have to wait until you

learn more about operating systems

Page 16: CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r Email: hanan at csd dot uwo ca r Office Hours: m Drop-by m Appointment.

Why Study Operating Systems? The example just presented is an

example of concurrency Concurrency leads to interesting

programming challenges that were first addressed in operating systems

Today the ability to understand concurrency is important in developing efficient software applications for today’s multi-core machines

Page 17: CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r Email: hanan at csd dot uwo ca r Office Hours: m Drop-by m Appointment.

Why Study Operating Systems?

The OS code is really large Windows 8 is rumoured to be between 30

and 80 million lines of code MAC OS is close to 90 millions lines of code Linux Debian Release 5 (with all packages)

is about 325 million lines of code Thus the study of OS design is a study of

the design of large software systems Understanding operating systems gives

you a leg up in understanding system security

Page 18: CS 3305 Course Overview. Introduction r Instructor: Dr Hanan Lutfiyya r Office: MC 355 r Email: hanan at csd dot uwo ca r Office Hours: m Drop-by m Appointment.

Why Study Operating Systems?

Ok – I’m still never going to write one from scratch.

Probably true But .. Studying operating systems gives

you insight into other areas of computer science Data structures, concurrency,

synchronization, resource management, distributed systems, networks