Quote:

The amount of happiness that you have depends on the amount of freedom you have in your heart
Showing posts with label CS604. Show all posts
Showing posts with label CS604. Show all posts

Thursday, 26 January 2012

CS604 operating system assignment 5 fall2011 solution

Operating System- CS604                                        I**dea Solution**
Assignment No: 05
Fall 2011

*It is the idea solution, complete and add some more data into it.


CS604 assignment 5 fall2011

Operating System- CS604
Assignment No: 05
Fall 2011
                                           Marks: 20

Question                                                                                                                  

You are to give detailed comparison of Linux, Windows vista and Windows 7 operating systems in the form of table. Comparison should be on the basis of following parameters.

File operations
Safety and security
Communication
Performance features


Thursday, 29 December 2011

CS604 Operating Systems assignment 3 Fall2011

Operating Systems (CS604)
Assignment # 3
Fall 2011

IDEA SOLUTION:
# These three are mutexes (only 0 or 1 possible)
Semaphore contractorReady = 0         # if 1, at least one contractor is ready
Semaphore ministerReady = 0
Semaphore accessWRSeats = 1       # if 1, the # of seats in the waiting room can be incremented or decremented
int numberOfFreeWRSeats = N     # total number of seats in the waiting room
def minister():
  while true:                   # Run in an infinite loop.
    wait(contractorReady)             # Try to acquire a contractor - if none is available, go to sleep. 
    wait(accessWRSeats)         # Awake - try to get access to modify # of available seats, otherwise sleep.
    numberOfFreeWRSeats++       # One waiting room chair becomes afree.
    signal(ministerReady)         # I am ready.
    signal(accessWRSeats)       # Don't need the lock on the chairs anymore.
    # (Enter Door 1.)
def Contractor():
  while true:                   # Run in an infinite loop.
wait(accessWRSeats)         # Try to get access to the waiting room chairs.
 if numberOfFreeWRSeats > 0: # If there are any free seats:
      numberOfFreeWRSeats--     #   sit down in a chair
   signal(contractorReady)         #   notify the minister, who's waiting until there is a contractor
      signal(accessWRSeats)     #   don't need to lock the chairs anymore
      wait(ministerReady)         #   wait until the minister is ready
      # (Finish the meeting here.)
    else:                      
# otherwise, there are no free seats;
      signal(accessWRSeats)     #   but don't forget to release the lock on the seats!
      # (Leave without a meeting with minister.)
      if minister=busy
      close D1;

Consult from this Example

Monday, 26 December 2011

CS604 Operating Systems Assignment 3 Fall2011

Operating Systems (CS604)

Assignment # 3

Fall 2011

                                                           Total Marks: 20

Assignment Statement

A chief minister office is designed in such a way that there is a waiting room adjoining the minister’s office. Waiting room has two doors D1 and D2, D1 opens inside the minister’s room and D2 is used for entrance from out side. Waiting room has N chairs for some contractors who have to see chief minister. If the minister is busy, the door D1 is closed and arriving contractor sits in one of the available chairs. If a contractor enters the waiting room and all chairs are occupied, the contractor leaves the office without meeting. If there are no contractors in the waiting room, the minister goes to rest (sleep) in the chair with the door D1 open. If minister is asleep, the contractor makes the minister awake by ringing the bell and gets meeting with him.
While keeping in mind the given scenario, you have to write the pseudo code OR code fragment using semaphores to define synchronization scheme for the contractor and chief minister.