COMP450 Operating Systems

Assignment due on Friday, March 28, 2003


Assume exponential arrival rates and service times unless otherwise indicated.

1.      Programs make an average of 90 requests to the disk every second.The disk hardware takes an average of 9.7 msec to complete each request.What is the average length of time that a program must wait from when it makes a disk request until it is complete?What is the average number of requests queued?How often are more than 4 requests queued or being served?

2.      Assume that you have a printer that can print an average file in two minutes.Every two and a half minutes a user sends another file to the printer.How long does it take before a user can get their output?To speed things up you can buy a second printer that is exactly the same as the one you have.How long will it take for a user to get their files printed if you had two identical printers?Another alternative is to replace the existing printer with one that can print a file in an average of one minute.How long does it take for a user to get their output with the faster printer?

3.      If the original printer above breaks down for 5 minutes, how many files can you expect to be generated while the printer is broken?What is the probability that no files will be generated while the printer was broken?

4.      You have a distributed disk server that seems too slow for your needs.Client I/O requests are generated at the average rate of 50 a second.The disk server requires an exponentially distributed average of 15 ms to perform the I/O request.How long does it take to complete an I/O request? (For this problem we will consider all aspects of handling an I/O request: the communication time, the disk time and the processing time; to be represented by the service time.)You can buy an additional identical disk server and randomly divide the files among the two servers.[Note: I/O requests must be serviced by the specific disk that contains the desired file.]How will this effect the average time to complete an I/O request?Alternatively you can discard your old disk server and buy a new one that requires an average of only 7.5 ms to service an I/O request.How will this effect the average time to complete an I/O request?Which is the better option?

5.      Consider a web server that provides access to archival documents for a large number of clients.The documents are read by the clients and never updated.The server gets 60 hits a second.The disk containing the documents requires an average of 14 ms to retrieve a document. How long will it take to read a document from the disk?To make the server run faster, it has been suggested that an additional disk and controller be added to the system.The new disk is the same type and speed of the previous disk.Each disk will have an identical copy of all documents.How long will it take to read a document from any disk?

6.      During the registration period, a new student arrives at the cashierís office every two minutes to pay their bill.It takes the cashier one minute and 45 seconds, on the average, to take the studentís money.How long will it take for a student to pay their bill (including any waiting)?On the average, how many students will be waiting to pay their bill?

7.      A network monitor reports that there are 90,000 I/O requests during an observation period of one hour.It took I/O requests an average of 60 msec to complete, including any queuing delay.What is the average hardware service time for the I/O device?

8.      Applications in a computer generate 800 Kbytes of information every second to be sent over a network.The network can send 1.25 Mbytes per second.One network system sends packets of varying length (exponentially distributed) that average 1000 bytes.Therefore it takes 1000 bytes / 1.25 x 106 bytes/sec = 0.8 milliseconds to send an average packet.How long must a packet wait before it starts to be sent?If the network software is replaced by a system that always sends fixed sized packets of 1000 bytes, how long must a packet wait before it starts to be sent?

9.      Consider a program with multiple threads.Three of the threads are generating messages to be sent to a remote server.Thread A generates 31 messages a second, thread B generates 15 messages a second and thread C generates 74 messages a second.Messages are put on a queue for the network thread to send.The network thread takes an average of 6.0 msec to send each message.How long do messages wait on the queue before they start being transmitted?What is the average size of the queue?

10.  In pseudo code (or any computer language you like) write a function sendmsg that threads A, B and C, from the above problem, can call to put a message on the queue.Write a function getmsg that the network thread can call to get messages from the queue.