c++ threading example docs

in Help Center
i have some trouble understanding the monitor queue example. after 5 producer and consumer are started, you are joining for all threads to complete. but can it not be, that if all queue items have been consumed, that there are still threads hanging in get()? so main could never join?
cheers
--
Sebastian Kropp
Masters in IT (Melbourne)
Software Engineer
cheers
--
Sebastian Kropp
Masters in IT (Melbourne)
Software Engineer
0
Comments
Cheers,
Michi.
i am very unsure how to do this efficiently. right now i am pulsing all threads when the producer have finished. the awakened thread realizes that the producer have finished and throws an exception instead of returning an item.
Problem with this is the added complexity of handling exceptions.
with your experience, would you do the same or how would you approach such a problem.