# Register now to access 7 million high quality study materials (What's Course Hero?) Course Hero is the premier provider of high quality online educational resources. With millions of study documents, online tutors, digital flashcards and free courseware, Course Hero is helping students learn more efficiently and effectively. Whether you're interested in exploring new subjects or mastering key topics for your next exam, Course Hero has the tools you need to achieve your goals.

1 Page

### homework-1

Course: CSE 521, Fall 2011
School: SUNY Buffalo
Rating:

Word Count: 199

#### Document Preview

421/521 CSE Operating Systems Fall 2011 - Homework Assignment #1 The due date is: September 15th, Thursday, before the class (9:30am). Late submission is not allowed. int main(int argc, char *argv[]) P{ roblem 1: if (argc != 2) exit(0); pid_t pid; int i, a, b, fib; int n = atoi(argv[1]); Problem 2: / fork switches used for and What are *context another process */ what does a typical context switch involve?...

Register Now

#### Unformatted Document Excerpt

Coursehero >> New York >> SUNY Buffalo >> CSE 521

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
421/521 CSE Operating Systems Fall 2011 - Homework Assignment #1 The due date is: September 15th, Thursday, before the class (9:30am). Late submission is not allowed. int main(int argc, char *argv[]) P{ roblem 1: if (argc != 2) exit(0); pid_t pid; int i, a, b, fib; int n = atoi(argv[1]); Problem 2: / fork switches used for and What are *context another process */ what does a typical context switch involve? pid = fork(); Compare processes versus threads in terms of context switch operation and overhead associated { /* it. if (pid < 0) with error occurred */ Problem 3: fprintf(stderr, "Fork Failed\n"); exit(-1); } else if (pid == 0) { /* child process */ if (n 1) printf("0\n"); else == if (n == 2) printf("0, 1\n"); else if (n > 2) { a = 0; b = 1; printf("0, 1,"); for (i = 3; i < n; i++) { fib = a + b; printf("%d,",fib); a = b; b = fib; } Problem 4: printf("%d\n",a+b); Discuss the tradeoffs } between user and kernel threads. } (a)lsehat are the advantages and*/ e W { /* parent process disadvantages of each? /* parent will wait for the child to complete */ wait(NULL); (b) Assume we can make system calls as fast as procedure calls using some new hardware mechanism. Would this make one kind of thread exit(0); clearly preferable over the other? Explain briefly. } } Problem 5:
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

SUNY Buffalo - CSE - 521
P roject - 1C S E 421/521 O perating SystemsD ue: O ctober 24 @ 11:59pm , 20111. PreparationBefore beginning your work, please read the following carefully: Chapters 4-6 from Silberschatz Lecture slides on Threads, CPU Scheduling and Synchronization
SUNY Buffalo - CSE - 521
9/7/11CSE 421/521 - Operating SystemsFall 2011 RecitationsRecitation - IUNIX C ProgrammingProf. Tevfik KosarPresented by Yuan(Alex) ZhangUniversity at BuffaloSeptember 20111logon ssh timberlake.cse.buffalo.edu -l username or: ssh username@tim
SUNY Buffalo - CSE - 521
9/13/11CSE 421/521 - Operating SystemsFall 2011 RecitationsRecitation - IIUnix ProcessesProf. Tevfik KosarPresented by Yuan(Alex) ZhangUniversity at BuffaloSeptember ., 20111In Todays Class Unix Process EnvironmentCreation &amp; Termination of Pro
SUNY Buffalo - CSE - 521
9/27/11CSE 421/521 - Operating SystemsFall 2011 RecitationsRecitation - IIINetworking &amp;Concurrent ProgrammingProf. Tevfik KosarPresented by .University at BuffaloSeptember ., 20111Network Programming219/27/11 TCP Client-Server view Connect
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Contact Information Instructor: Prof. Tevfik Kosar Office: 292 Coates (also 333 Johnston) Phone: 578-9483 Email: kosar@csc.lsu.edu Web: http:/www.cct.lsu.edu/~kosar Office hours: Wed &amp; Thu, 2:00pm - 3:00pm(Or anyt
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009IntroductionLecture - ITevfik Ko!arLouisiana State UniversityAugust 25th, 20091Contact Information Instructor: Prof. Tevfik Kosar Office: 292 Coates (also 333 Johnston) Phone: 578-9483 Email: kosar@csc.lsu.ed
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Announcements TA Changed. New TA: Praveenkumar Kondikoppa Email: pkondi1@lsu.eduOS StructuresLecture - II All of you should be now in the class mailing list. Let me know if you havent received any messages yet.
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009OS StructuresLecture - IITevfik Ko!arLouisiana State UniversityAugust 27th, 20091Announcements TA Changed. New TA: Praveenkumar Kondikoppa Email: pkondi1@lsu.edu All of you should be now in the class mailing
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009 ProcessesRoadmap Basic Concepts Process Creation Process Termination Context Switching Process Queues Process Scheduling Interprocess CommunicationProcessesLecture - IIITevfik Ko!arLouisiana State UniversitySe
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009ProcessesLecture - IIITevfik Ko!arLouisiana State UniversitySeptember 1st, 20091Roadmap Processes Basic Concepts Process Creation Process Termination Context Switching Process Queues Process Scheduling Interp
LSU - CSC - 4103
LSU - CSC - 4103
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009 CPU SchedulingRoadmap Basic Concepts Scheduling Criteria &amp; Metrics Different Scheduling Algorithms FCFS SJF Priority RRCPU Scheduling - ILecture - VTevfik Ko!arLouisiana State UniversitySeptember 10th, 20091
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009CPU Scheduling - ILecture - VTevfik Ko!arLouisiana State UniversitySeptember 10th, 20091Roadmap CPU Scheduling Basic Concepts Scheduling Criteria &amp; Metrics Different Scheduling Algorithms FCFS SJF Priority R
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009 RoadmapMultilevel Feedback Queues Estimating CPU bursts Project Discussion System Calls Virtual MachinesCPU Scheduling - IILecture - VIITevfik Ko!arLouisiana State UniversitySeptember 14th, 20091 2Multilevel
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009CPU Scheduling - IILecture - VIITevfik Ko!arLouisiana State UniversitySeptember 14th, 20091Roadmap Multilevel Feedback Queues Estimating CPU bursts Project Discussion System Calls Virtual Machines2Multilevel
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Roadmap Process Synchronization Race Conditions Critical-Section Problem Solutions to Critical Section Different ImplementationsProcess Synchronization - ILecture - VIIITevfik Ko!arLouisiana State UniversitySe
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Process Synchronization - ILecture - VIIITevfik Ko!arLouisiana State UniversitySeptember 17th, 20091Roadmap Process Synchronization Race Conditions Critical-Section Problem Solutions to Critical Section Diffe
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Roadmap Solutions for Critical-Section Problem Semaphores Classic Problems of Synchronization Bounded Buffer Readers-Writers Dining Philosophers Sleeping BarberProcess Synchronization - IILecture - IXTevfik Ko!a
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Process Synchronization - IILecture - IXTevfik Ko!arLouisiana State UniversitySeptember 22nd, 20091Roadmap Solutions for Critical-Section Problem Semaphores Classic Problems of Synchronization Bounded Buffer
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009 DeadlocksRoadmap Deadlock Characterization Deadlock Detection Resource Allocation GraphsDeadlocks - ILecture - X Classic Problems of Synchronization Bounded BufferTevfik Ko!arLouisiana State UniversitySepte
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Deadlocks - ILecture - XTevfik Ko!arLouisiana State UniversitySeptember 24th, 20091Roadmap Deadlocks Deadlock Characterization Deadlock Detection Resource Allocation Graphs Classic Problems of Synchronizati
LSU - CSC - 4103
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Deadlocks - IILecture - XITevfik Ko!arLouisiana State UniversitySeptember 29th, 20091Roadmap Classic Problems of Synchronization Bounded Buffer Readers-Writers Dining Philosophers Sleeping Barber Deadlock Pr
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Deadlock Detection Allow system to enter deadlock stateDeadlocks - IIILecture - XII Detection algorithm Recovery schemeTevfik Ko!arLouisiana State UniversityOctober 6th, 20091 2Single Instance of Each Resour
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Deadlocks - IIILecture - XIITevfik Ko!arLouisiana State UniversityOctober 6th, 20091Deadlock Detection Allow system to enter deadlock state Detection algorithm Recovery scheme2Single Instance of Each Resourc
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Midterm Exam October 15th, Thursday 3:10pm-4:30pm @1112 Patrick Taylor HallMidterm ReviewLecture - XIVTevfik Ko!arLouisiana State UniversityOctober 13th, 20091Chapters included in the Midterm Exam Ch. Ch. Ch.
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Midterm ReviewLecture - XIVTevfik Ko!arLouisiana State UniversityOctober 13th, 20091Midterm Exam October 15th, Thursday 3:10pm-4:30pm @1112 Patrick Taylor HallChapters included in the Midterm Exam Ch. Ch. Ch.
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009 Midterm Discussion Project 1 Discussion Main Memory RoadmapMain Memory - ILecture - XVITevfik Ko!arLouisiana State UniversityOctober 22nd, 20091Introduction Contiguous Allocation Dynamic Allocation Algorithm
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Main Memory - ILecture - XVITevfik Ko!arLouisiana State UniversityOctober 22nd, 20091Roadmap Midterm Discussion Project 1 Discussion Main Memory Introduction Contiguous Allocation Dynamic Allocation Algorithm
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009 PagingRoadmap Address Translation Scheme Shared PagesMain MemoryLecture - XVII Segmentation Address Translation Scheme Shared SegmentsTevfik Ko!arLouisiana State UniversityOctober 27th, 20091 2Paging - non
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Main MemoryLecture - XVIITevfik Ko!arLouisiana State UniversityOctober 27th, 20091Roadmap Paging Address Translation Scheme Shared Pages Segmentation Address Translation Scheme Shared Segments2Paging - no
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009 Virtual MemoryRoadmap Demand Paging Page Faults Page Replacement Page Replacement Algorithms (FIFO, LRU, Optimal etc) Performance of Demand PagingVirtual MemoryLecture - XVIIITevfik Ko!arLouisiana State Univers
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Virtual MemoryLecture - XVIIITevfik Ko!arLouisiana State UniversityOctober 29th, 20091Roadmap Virtual Memory Demand Paging Page Faults Page Replacement Page Replacement Algorithms (FIFO, LRU, Optimal etc) Per
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Least Recently Used (LRU) Algorithm Reference string: 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5Virtual Memory - IILecture - XIX1 2 3 455 34Tevfik Ko!arLouisiana State UniversityNovember 3rd, 20091 How to impleme
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Virtual Memory - IILecture - XIXTevfik Ko!arLouisiana State UniversityNovember 3rd, 20091Least Recently Used (LRU) Algorithm Reference string: 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 51 2 3 4 5 3 4 5 How to impleme
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009File Systems Provides organized and efficient access to data on secondary storage:1. Organizing data into files and directories and supporting primitives to manipulate them (create, delete, read, write etc) 2. Impr
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009File SystemsLecture - XXTevfik Ko!arLouisiana State UniversityNovember 5th, 20091File Systems Provides organized and efficient access to data on secondary storage:1. Organizing data into files and directories
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009 Overview of Mass Storage Structure Magnetic disks provide bulk of secondary storage of modern computersDrives rotate at 90 to 300 times per second Transfer rate is rate at which data flow between drive and comput
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Mass Storage &amp; IOLecture - XXITevfik Ko!arLouisiana State UniversityNovember 10th, 20091Overview of Mass Storage Structure Magnetic disks provide bulk of secondary storage of modern computers Drives rotate at
LSU - CSC - 4103
CSC 4103 - Operating SystemsFall 2009RAID Structure As disks get cheaper, adding multiple disks to the samesystem provides increased storage space, as well asincreased reliability and performance.Lecture - XXIIMass Storage and I/O - II RAID: Redun
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Mass Storage and I/O - IILecture - XXIITevfik Ko!arLouisiana State UniversityNovember 12th, 20091RAID Structure As disks get cheaper, adding multiple disks to the same system provides increased storage space,
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009The Security Problem Protecting your system resources, your files, identity, confidentiality, or privacy Intruders (crackers) attempt to breach security Threat is potential security violation Attack is attempt to br
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Protection and SecurityLecture - XXIIITevfik Ko!arLouisiana State UniversityNovember 19th, 20091The Security Problem Protecting your system resources, your files, identity, confidentiality, or privacy Intruder
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Distributed Coordination Ordering events and achieving synchronization in centralized systems is easier. We can use common clock and memoryDistributed SystemsLecture - XXIV What about distributed systems? No co
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Distributed SystemsLecture - XXIVTevfik Ko!arLouisiana State UniversityDecember 1st , 20091Distributed Coordination Ordering events and achieving synchronization in centralized systems is easier. We can use c
LSU - CSC - 4103
AnnouncementsCSC 4103 - Operating SystemsFall 2009* You should have received your grades as well as graded papers for:- Homework 1-4- Quiz 1-3- MidtermIf not, please see me.Lecture - XXVFinal Review* Only two quizzes with highest grade out of th
LSU - CSC - 4103
CSC 4103 - Operating Systems Fall 2009Final ReviewLecture - XXVTevfik Ko!arLouisiana State UniversityDecember 3rd, 20091Announcements* You should have received your grades as well as graded papers for: - Homework 1-4 - Quiz 1-3 - Midterm If not, p
LSU - CSC - 4103
Fall 2009 CSC 4103 Operating Systems Homework Assignment #1The due date is: September 15th, Tuesday, before the class. Late submission is not allowed. Problem 1:Problem 2: What are context switches used for and what does a typical context switch involve
LSU - CSC - 4103
Fall 2009CSC 4103 Operating SystemsHomework Assignment #2The due date is: September 29th, Tuesday, before the class. Late submission is notallowed.Problem 1:Problem 2:Problem 3:Which of the following scheduling algorithms could result in starvatio
LSU - CSC - 4103
Fall 2009CSC 4103 Operating SystemsHomework Assignment #3The due date is: November 5th, Thurday, before the class. Late submission is not allowed.Problem 1:Explain the difference between internal and external fragmentation. Suggest ways toprevent ea
LSU - CSC - 4103
Fall 2009CSC 4103 Operating SystemsHomework Assignment #4The due date is: November 19th, Thursday, before the class.Problem 1:Consider a system where free space is kept in a free-space list.a. Suppose that the pointer to the free-space list is lost.
LSU - CSC - 4103
P roject - 1C SC 4103 O perating SystemsD ue: O ctober 20 th @ 11:59pmIn this project, you will learn how to simulate Operating Systems and how to implementsome Operating System components in OSP environment. Your task in this project willbe to imple
LSU - CSC - 4103
P roject - 2C SC 4103 O perating SystemsD ue: D ecember 1 st @ 11:59pmYour task in this project will be to implement the Memory Management component ofan Operating System using OSP. Please read all instructions carefully before starting theproject.1
UPR Río Piedras - COPU - REPU 4018
An Introduction toIntegrated MarketingCommunications 2007 McGraw-Hill Companies, Inc., McGraw-Hill/IrwinTraditional Approach to MarketingCommunicationsPointofpurchaseSpecialeventsPublicityMediaAdvertisingPublicrelationsDirectmarketingSal
UPR Río Piedras - COPU - REPU 4018