CS 241 Section Week - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

CS 241 Section Week

Description:

Dinning Philosophers. What is underflow? Overflow? ... Make sure to know which room you'll be taking the exam in! All multiple choice questions: ... – PowerPoint PPT presentation

Number of Views:19
Avg rating:3.0/5.0
Slides: 22
Provided by: Alej198
Category:
Tags: dinning | room | section | week

less

Transcript and Presenter's Notes

Title: CS 241 Section Week


1
CS 241 Section Week 7(10/09/08)
2
Topics This Section
  • MP 4
  • HW 2
  • Exam Review

3
MP 4
4
MP4
  • The scenario

5
MP4
  • The scenario

6
MP4
  • Request 1 (v1), (v2), (v3)

Lock Queue
Queue Data
Notify Server
Wait for Response
  • Response 1 (r1)

Notified of Response
Get Response
(Prep next request)
7
MP4 Forward
  • Communication is done through shared memories
  • client_resultclient_id
  • You need to deal with three semaphores
  • queue_semaphore
  • To protect access to the queue
  • server_notify_semaphore
  • Client notify the server when data is added to
    the queue
  • client_notify_semaphore
  • Array of semaphores
  • Client ID is used to access the semaphores
  • Server notify individual client a response is
    ready

8
MP4 Forward
  • MP has no questions this time.
  • 80 of your grade is programming.
  • Make sure your program compiles and works!

9
HW 2
10
HW2
  • Homework 2 Solutions are online
  • Make sure you review your HW 2 answers w/ the
    solutions.
  • Unlikely youll get HW 2 back before the exam.

11
HW2
  • Problem areas in HW 2
  • Scheduling algorithms
  • No algorithm causes deadlock.
  • Some algorithms may cause starvation.
  • Process forking
  • When fork() is called, these are two returns!
  • The following is not to process tree
    Correct Response

12
Exam Review
13
Exam Review
  • Week 1 Introduction to C programming
  • What is a C program?
  • What is a pointer?
  • How do you declare a pointer?
  • What is heap memory?
  • What is stack memory?
  • What is a static variable in C?
  • How is that different than Java?

14
Exam Review
  • Week 2 Strings and System Calls
  • How is a string represented in C?
  • What does strlen() do?
  • What does strcpy() do?
  • What does strcat() do?
  • ...
  • What is the difference between a system call and
    a function call?
  • What is an example of a system call?
  • ... a function call?

15
Exam Review
  • Week 3 Threads and Processes
  • What is a thread?
  • What is a light-weight (user-level) thread?
  • How does that differ from a kernel-level thread?
  • What is a process?
  • What are the five states a process may be in?
  • What is a zombie process? An orphan?
  • How do you create threads and processes?
  • pthread_create()
  • fork()
  • pthread_join()
  • ...

16
Exam Review
  • Week 4 Scheduling
  • Why do we have different scheduling algorithms?
  • What are statistics on scheduling algorithms that
    are meaningful?
  • What are some common scheduling algorithms?
  • What is FCFS?
  • SJF?
  • PRI?
  • RR?
  • What is the difference between pre-emptive and
    non-pre-emptive scheduling?

17
Exam Review
  • Week 5 Synchronization
  • Why do we need to synchronize threads/processes?
  • What is a trivial example showing a
    synchronization problems?
  • What are semaphores?
  • What is the difference between a binary mutex and
    a counting semaphore?
  • What is test_and_set()?

18
Exam Review
  • Week 6 Classic Synchronization
  • What are OS examples showing the need for
    synchronization?
  • Producer / Consumer
  • Reader / Writer
  • Dinning Philosophers
  • What is underflow? Overflow?
  • What are the four necessary conditions of
    deadlock?
  • Mutual Exclusion
  • Hold and Wait
  • No Preemption
  • Circular Wait

19
Exam Review
  • Week 7 Deadlocks
  • How can we detect deadlocks?
  • What is a resource allocation graph?
  • What is a wait-for graph?
  • What is
  • Deadlock detection?
  • Deadlock avoidance?
  • Deadlock prevention?
  • What do UNIX/Windows actually do?
  • Ostrich Solution

20
Exam Format
  • In-class exam on Monday.
  • Exam begins promptly at 1000am, be there early.
  • Full 50 minutes for exam.
  • Make sure to know which room youll be taking the
    exam in!
  • All multiple choice questions
  • 25-30 quick questions
  • 5 longer questions
  • Closed book, closed notes.
  • Must bring I-Card.

21
TA Review
  • Optional TA Review Session
  • The TAs will hold an optional review session to
    answer last-minute exam questions
    Saturday, October 11, 2008 2pm
    (whenever) 2405 SC
Write a Comment
User Comments (0)
About PowerShow.com