1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

pls help me on operating system linux

Discussion in 'Linux' started by paradise, Apr 5, 2010.

  1. paradise

    paradise New Member

    Joined:
    Apr 5, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Write a C program that accepts 3 parameters. Each parameter indicates the quantity of product to be
    produced. Each product will be produced in different production line. Ready products will be placed
    in a buffer area located at the end of each production line. Packaging workers will pack the products
    into boxes. Information of each production line as follow:
    Production line A: product ready in 1-2 minutes, buffer capacity: 12 units
    Production line B: product ready in 2-3 minutes, buffer capacity: 6 units
    Production line C: product ready in 1-2 minutes, buffer capacity: 24 units
    There are currently 2 packaging workers available. Each worker needs 2 minutes to pack 6 units of
    product into a box. The production line will be temporary suspended if the buffer area is full of
    product. The operation will continue when the worker has taken 1 unit of product from the buffer
    area.
    Simulate the operation of production line and the packaging workers by using threads and
    appropriate semaphores. There are at least 5 threads, but you may use additional thread if it is
    necessary. You have to decide how the workers select the product to pack. Assume that 1 second in
    your program is equivalent to 1 minute.
    Sample output:​
    ...
    Buffer A: 11
    Buffer C: 4
    Worker X packing B: 3
    Buffer B: 8
    Worker Y packing C: 2
    Buffer A: 12
    Production line A suspended.​
    ...
     
  2. en_7123

    en_7123 New Member

    Joined:
    Feb 11, 2010
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    0
    Where is the code that you have written ??
     
  3. paradise

    paradise New Member

    Joined:
    Apr 5, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    I attached the code ....
     

    Attached Files:

    • os.txt
      File size:
      1.8 KB
      Views:
      4

Share This Page