There is a main class starting threads for Producers and Consumers in this manner (Producers push onto a stack, consumers pop):
Consumer.start()
Producer.start()
Consumer.start()
Producer.start()
I need to make sure that the 2 producers enter first, then the 2 consumers.
Right now I have a semaphore.wait() (set to 0 initially so it won't run) in the Consumer class. Right now I'm using semaphore.signal() at the end of the Producer class, but that isn't right (I need the 2 Producers to run first).
Where can I put my semaphore.signal() ? (I can't change my main, so I can't put it after my second Producer.start()

)
/e It seems as if my code is running correctly, but I'm pretty sure it's just a coincidence xD
This post was edited by IsraeliSoldier on Feb 24 2013 09:28am