lecture 14 -- misc topics. * make sure you fix permissions issues with this project! 80% of people we could not reach your files for assn 2! in moloney's class, there are 3 projects left: * producer-consumer problem using threads. goal is to understand how multi-cpu systems and thread priorities work. also, diff betw proc threads and sys threads on unix (alpha) (2 weeks) * memory allocation. (2 weeks) * unix FS. (1 week) I am open to suggestions as to what to focus on. Talked yet again about the donut problem. This time, realized that 1. Unix semaphores do NOT need to live in shared memory segment. As long as each proc has the key, it can attach to them. 2. Each donut ring has associated with it: in_ptr -- location where produced donut will go. outptr -- location where removed donut will come from. 1 semaphore group of 3 entries: "PROD" index -- equiv to num of "empty" slots "CONSUMER" index -- equiv to num of "full" slots "OUTPTR" index -- used as mutex With the donut problem as stated, there is only one producer and multiple consumers. Therefore, the producer does not need a mutex to control access the donut rings. Indeed, in the starter code, "in_ptr", the array of indices into the 4 rings used by the producer to insert donuts, is local. None of the consumers has access to it. It is therefore unnecessary to use a mutex to control access to the in_ptr array.