ADOS: ASSIGNMENT 2


There are two questions in this assignment. Answer both of them.

Submission Instructions:

  1. Programs should be in individual files named according to the question numbers.
  2. Explanations should be in either a single PDF or .docx file
  3. Tar all the files, compress it and create a single tgz file with your Roll Number as the filename
  4. Email the compressed tar file to chakcs@dcis.uohyd.ernet.in Email to any other address is not allowed.
  5. Email subject line MUST include the phrase ADOS ASSIGNMENT-2

QUESTIONS

  1. A bank has three entrances and eight counters. Each entrance has a token issuing machine next to it. A customer enters or exits the bank through any of the entrances. He/she then collects a token and waits for the token number to be 'called' by any counter. The calling of a token is taken to mean that the customer finishes his/her job and exits from the bank.

    It must be ensured that:

    Write a program that uses multiple threads for the token issuing machines and counters with appropriate synchronisation primitives. Describe your data structures with diagrams, and choice of synchronization primitives with justification.
  2. Implement the program given in sample code "Linear Buffer Example" on 9 September in the course webpage using named semaphores.

REMEMBER THE ASSIGNMENT IS DUE ON 30 SEPTEMBER 2014