The 'solution' is that you change the mutex into a ProducerMutex and a ConsumerMutex. The mutex semaphore makes sure there are no 2 processes working in the buffer at the same time, so I don't see how this property can possibly change if you have more processes. In this project, we will design a programming solution to the bounded-buffer problem using the producer and consumer processes. Why will this not work if I have more than 1 producer and/or more than 1 consumer? I've looked everywhere, but I can't find an answer I understand :s. The typical approach for 1 consumer and 1 producer looks like this : Producer : It appears in my lecture notes, but I simply cannot understand why the single consumer/producer approach won't work. This ensures that put( ) executes first.I'm a bit stuck on the multiple consumer/producer problem. It is OK for wheel mounter to get Another example: compiler & disk reader. For example, must put wheels on before the hub caps. Processes do not have to operate in perfect lock-step, but a certain order must be maintained.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |