1 / 9

Homework Assignment #1

Homework Assignment #1. J. H. Wang Sep. 30, 2009. Homework #1. Chap.1: 1.22 Chap.2: 2.10 Chap.3: 3.5, 3.18* Chap.4: 4.6, 4.12* (Optional: End-of-chapter project for Chap.3 & 4) Due: two weeks ( Oct. 14, 2009 ). Chap.1

chenoa
Download Presentation

Homework Assignment #1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Homework Assignment #1 J. H. Wang Sep. 30, 2009

  2. Homework #1 • Chap.1: 1.22 • Chap.2: 2.10 • Chap.3: 3.5, 3.18* • Chap.4: 4.6, 4.12* • (Optional: End-of-chapter project for Chap.3 & 4) • Due: two weeks (Oct. 14, 2009)

  3. Chap.1 • 1.22: Describe the differences between symmetric and asymmetric multiprocessing. What are three advantages and one disadvantage of multiprocessor systems? • Chap.2 • 2.10: What is the main advantage of the layered approach to system design? What are the main disadvantages of using the layered approach? • Chap.3 • 3.5: Describe the actions taken by a kernel to context-switch between processes.

  4. 3.18*: Design a program using ordinary pipes in which one process send a string message to a second process, and the second process reverses the case of each character in the message and sends it back to the first process. For example, if the first process sends the message Hi There, the second process will return hI tHERE. This will require using two pipes, one for sending the original message from the first to the second process, and the other for sending the modified message from the second back to the first process. You may write this program using either UNIX or Windows pipes.

  5. Chap.4 • 4.6: What are two differences between user-level threads and kernel-level threads? Under what circumstances is one type better than the other?

  6. 4.12*: The Fibonacci sequence is the series of numbers 0, 1, 1, 2, 3, 5, 8, … . Formally, it can be expressed as:fib0=0fib1=1fibn=fibn-1+fibn-2Write a multithreaded program that generates the Fibonacci sequence using either the Java, Pthread, or Win32 thread library. This program should work as follows: The user will enter on the command line the number of Fibonacci numbers that the program is to generate. The program will then create a separate thread that will generate the Fibonacci numbers, placing the sequence in data that can be shared by the threads (an array is probably the most convenient data structure). When the thread finishes execution, the parent thread will output the sequence generated by the child thread. Because the parent cannot begin outputting until the child finishes, this will require having the parent wait for the child thread to finish.

  7. Homework Submission • For hand-written exercises, please hand in your homework in paper version in class • For programming exercises, please turn in your program code with compilation instructions via program submission site as follows: • URL: http://140.124.183.12/os/ • User account/Password: your student ID • Please change your password as soon as possible • Program uploading: including source codes and a compilation instruction if your program needs special environment or tool to compile or run • Please clearly name your program files using your ID

  8. More on Optional End-of-Chapter Projects • Programming Project for Chap. 3: POSIX Message Passing • The message passing system • Creating the processes • Programming Project for Chap. 4: • 1. Naming service project • Server and client • 2. Matrix multiplication project • Passing parameters to each thread • Waiting for threads to complete

  9. Thanks for Your Attention!

More Related