Abnormal producer consumer problem driving me nuts | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Abnormal producer consumer problem driving me nuts

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-05-2013
alexantosh alexantosh is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 5 January 2013, 4:53 PM EST
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
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:


Code:
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.

Moderator's Comments:
Homework in wrong forum. Closed.

Last edited by jim mcnamara; 01-05-2013 at 08:02 AM..
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 04:02 PM
Short code driving me nuts. daddygrant Shell Programming and Scripting 9 02-09-2009 01:22 PM
producer-consumer problem joey Programming 2 12-20-2008 08:09 AM
Dumb question but its driving me nuts jepombar UNIX for Dummies Questions & Answers 3 07-03-2007 02:32 PM
Producer/Consumer poorni_uma UNIX for Dummies Questions & Answers 3 07-08-2005 08:03 AM



All times are GMT -4. The time now is 11:20 PM.