Object wait

Hi plp..
I'm having some problems with overhead in my thread, when I use the sleep with 2 seconds it does not happen, but when I use the "fast mode", 1 millisecond the problem occurs.

This thread are checking a queue, so if there're no elements, it check again, at Java i resolve it with the .wait() and notifyAll() command, but in C++ I don't know.

What can I do to resolve it?!

Thanks all.
What thread library are you using?

I think you need to read up on 'condition variables' for whatever library it is.
Yeah man,
Condition variables resolved my problem.

PS. I'm using boost thread library.

Thanks.
Topic archived. No new replies allowed.