Results 1 to 2 of 2
Thread: Help with Threads
- 10-23-2011, 08:34 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 6
- Rep Power
- 0
Help with Threads
I have to do this program. and i am having trouble managing threads and semaphores. if someone could point me in the right direction that would great!
You must simulate a factory that produces tables, chairs and cabinets. The fabrication each needs three elements in the following proportion:
Nails Wood Formica
Tables 7 4 9
Chairs 3 6 1
Cabinets 5 8 2
The company buys raw material for individual orders. The creation of new products must follow the ration 1:4:3, i.e. production priorities are 4 chairs, 3 cabinets for each table you create.
The factory receives an order for each of its products, does not meet the above ratio it does not matter. The excess is stored as stock products for the next order.
By way of work, storage prior stock orders will be entered at the keyboard before the simulation. You must show the quantity produced of each product and remaining stock.
You must use threads to simulate the processes of purchasing and production.
Thanks,
GICP89
- 11-01-2011, 10:00 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
Re: Help with Threads
The nails, wood and formica are the shared resouces; the tables, chairs and cabinets are the consumers, i.e. they consume nails, wood and formica. If there isn't enough stock, each consumer just waits until there is. There has to be a stock 'filler' that fills up the amount of nails, wood and formica (the shared resources) and it notifies the waiting consumers. This 'refiller' is the producer.
kind regards,
JosBuild a wall around Donald Trump; I'll pay for it.
Similar Threads
-
How to use two threads
By rajan701v in forum Threads and SynchronizationReplies: 2Last Post: 07-22-2011, 06:47 PM -
Threads
By nsr2008.mca in forum New To JavaReplies: 7Last Post: 10-18-2010, 12:47 PM -
Threads!
By rameshraj in forum Advanced JavaReplies: 1Last Post: 05-04-2008, 05:11 PM -
Using threads
By Java Tip in forum Java TipReplies: 0Last Post: 12-11-2007, 11:25 AM -
Threads
By one198 in forum Threads and SynchronizationReplies: 1Last Post: 11-20-2007, 07:15 PM
Bookmarks