On Fri, Mar 23, 2012 at 8:43 AM, Arno <arno.schaefer@sqs.de> wrote:

is there nobody who has some experience in this aerea?
Our thread, what should run in an endless loop, crashes without any notice
in the call:
  boost::this_thread::sleep(boost::posix_time::milliseconds(millisec_));

The visual studio 2008 debugger didn't stop in any exception, so what can
cause this crash and how can I find out the reason? The problem is reproducible
in our complex scenario.

regards
Arno

Is this really a correct way of calling sleep? There are 2 overloads of sleep function:
The one which defines the duration (how long to sleep) and the other the time-point until which the thread should at least sleep. I assume you are going to use the second one, therefore the call should be:
    boost::this_thread::sleep(boost::get_system_time()+boost::posix_time::milliseconds(millisec_));

Hope this is going to resolve your issue... I wonder if that is really intended that an implicit cast from milliseconds to system_time or duration object is really a good idea???


With Kind Regards,
Ovanes