Click here to Skip to main content
15,891,409 members
Please Sign up or sign in to vote.
1.00/5 (7 votes)
See more:
Write a program to model the producer consumer problem. The producer has a fixed buffer size and cannot produce when it is full. On the other side, the consumer consumes form a fixed buffer size that is fed by the producer. The consumer cannot consume from an empty buffer
Posted
Updated 10-Apr-11 17:28pm
v2
Comments
Smithers-Jones 10-Apr-11 8:30am    
lazy demanding prick!
Sergey Alexandrovich Kryukov 10-Apr-11 22:16pm    
Yes, but nevertheless, see my "Answer" :-)
--SA
Sandeep Mewara 10-Apr-11 11:51am    
No effort.
Sergey Alexandrovich Kryukov 10-Apr-11 22:16pm    
No, but it's easy to answer. :-) Please see my Answer.
--SA

If you are going to post your homework, at least try to make it look like you have attempted to do something yourself!

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, or learn the Magic Words: "Do you want fries with that?"
 
Share this answer
 
Comments
juma owori 10-Apr-11 8:30am    
i wanted the c++ codes to this question.its not a homework am tryng to perfect in programming
Smithers-Jones 10-Apr-11 8:31am    
"i wanted the c++ codes to this question" - nobody gives code away for free, without you showing some effort.
OriginalGriff 10-Apr-11 8:33am    
And how is giving you a complete solution going to help you do that?
Smithers-Jones 10-Apr-11 8:38am    
Some people seem to think, that to be perfect in something means to let others do all the work and claim succcess for that.
OriginalGriff 10-Apr-11 8:46am    
That's what I've been doing wrong! :laugh:
Do you mean "provide C++ code for this question"?
Nothing could be easier!

C++
#include <iostream>

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
    cout << "Write a program to model the producer consumer problem. " << 
    "The producer has a fixed buffer size and cannot produce when it is full. " <<
    "On the other side, the consumer consumes form a fixed buffer size that is fed by the producer. " <<
    "The consumer cannot consume from an empty buffer.";
}


Note: precise formulation of Question can be critically important.

—SA
 
Share this answer
 
v2
Comments
Albert Holguin 10-Apr-11 22:30pm    
this is hilarious! i literally almost fell out of my seat!
Sergey Alexandrovich Kryukov 10-Apr-11 22:32pm    
Thank you Albert.
--SA
Albert Holguin 10-Apr-11 22:34pm    
no, no... thank you!
Hans Dietrich 10-Apr-11 23:27pm    
Classic! This one should go to Q&A Hall of Fame.
Sergey Alexandrovich Kryukov 10-Apr-11 23:54pm    
Thank you very much, Hans!
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900