Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Java threads

spooky1970spooky1970 Member Posts: 1
New to java so here goes,

I writing a ConsumerProducer thread that shares an update method. This method receives an int (either 1 or -1 ). Inside main I also print out the difference in the values of the Consumer and Producer.
As well as making the shared update method synchronized should I also make the print method also synchronized. I dont want to to use the wait() and notifyAll() methods to get this working. Any help would be appreciated.
Sign In or Register to comment.