Abnormal producer consumer problem driving me nuts
normally, i hate asking someone to do my homework for me but am getting desperate right now.
i have a project about consumer producer problem. the deadline is tonight at 23:55. but i havent gotten it working yet. i just COULDNT get it to work right yet.
the problem is as follows: the C - program will prompt for the following integer inputs:
m: the number of producer threads n: the number of consumer threads k: the size of the bounded buffer array i: the number of candy items to be filled in each box
j: the number of candy items produced by each producer thread before it quits
now each producer thread produces a specific candy item, and each consumer thread takes an item out of the buffer one at a time. say producer1 produces red, prducer2 blue and so on.. as for consumer threads. after a given consumer thread has filled a given box; it prints the contents of the box as follows:
Consumer thread A filled a new box of candy containing: blue 3, red 7, green 8, ...
if you dont have the time to waste on beginngers' coding: atleast please hint out on how i should plan my work, because may be my problem is in the code structure. thanks
my head is now throbbing i can nolonger even think straight. anyhelp will be deeply appreciated. thanks in advance.
Last edited by jim mcnamara; 01-05-2013 at 09:02 AM..
|Thread Tools||Search this Thread|
|More UNIX and Linux Forum Topics You Might Find Helpful|
|Thread||Thread Starter||Forum||Replies||Last Post|
|producer consumer||gokult||Programming||0||12-01-2010 05:02 PM|
|Short code driving me nuts.||daddygrant||Shell Programming and Scripting||9||02-09-2009 02:22 PM|
|producer-consumer problem||joey||Programming||2||12-20-2008 09:09 AM|
|Dumb question but its driving me nuts||jepombar||UNIX for Dummies Questions & Answers||3||07-03-2007 03:32 PM|
|Producer/Consumer||poorni_uma||UNIX for Dummies Questions & Answers||3||07-08-2005 09:03 AM|