Producer and Consumer – Part 2

Yesterday the temperature in the Twin Cities of Minneapolis and St. Paul reached 72F which is quite pleasant for this time of the year. Today we are expecting 42F for a high. That is a drop of 30F! At least the day is forecasted to be sunny.

I also received a message from regarding my post Revenue Milestones in Java. Not sure what it was all about so I will not comment on it at this time. If I could get an updated comment, I will review and reply as needed. Thanks. Continue reading “Producer and Consumer – Part 2”

Producer and Consumer – Part III

This is the third and last part of this sequence. We will swap the mutex (implemented as a Semaphore) with a modifier per method in the Ring Buffer class.

First let’s take a look at the output from the Eclipse IDE console:

main <<< start sequential …

main <<< done sequential

main <<< producer started …

Producer <<< started

main <<< consumer started …

main <<< waiting for threads to be done …

Consumer <<< started

Producer <<< done

Consumer <<< done

main <<< threads are done Continue reading “Producer and Consumer – Part III”