Boost logo

Boost Users :

Subject: [Boost-users] boost::thread condition variables
From: Eric J. Holtman (eric_at_[hidden])
Date: 2010-05-08 20:10:54


(using windows XP, VS2008)

Is there a limit to the number that can be constructed/destructed in a
single process over time?

I have a loop which was doing

while (1) {
     condition_variable cv;
     mutex mx;

     // do some things with cv and mx
}

that while loop would run maybe 200 or 300 times.

Occasionally, I'd get a crash in notify_all (), where it
seemed like a handle wasn't valid.

When I move the declaration of the variables outside
the while loop, this doesn't happen.

Now, it's entirely possible that I have some other
bizarre race condition. In fact, if my previous years
of experience have taught me anything, I will discover
that error in the very next session after I hit "send"
on this email.

However..... is there some limit to constructing/destructing
and using up Windows handles that I should know about?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net