|
Boost Users : |
Subject: Re: [Boost-users] Thread changes from Boost 1.38 to 1.45
From: Ven Tadipatri (ven.tadipatri_at_[hidden])
Date: 2011-02-07 11:37:02
It appears the problem has to do with the thread being interrupted. For
some reason in Boost 1.45, when a thread is given the interrupt command,
it's either ignored, or something is prevented from checking for the
interrupt. The only change I can see in the interrupt method is the
acquisition of an internal lock (line 414 in thread.cpp in Boost 1.45):
boost::pthread::pthread_mutex_scoped_lock
internal_lock(local_thread_info->cond_mutex);
This line isn't present in Boost 1.38.
As a sort of hack I was able to call interrupt on the thread, then
call sleep on that thread for 20 milliseconds (some arbitrary time). The
documentation states there are interruption points, so the thread only
interrupts when it reaches one of those points:
http://www.boost.org/doc/libs/1_45_0/doc/html/thread/thread_management.html#interruption_points
Was this behavior changed so that now when interrupt is called on a
thread it doesn't actually get interrupted until one of these other
methods are called? Previously, when interrupt was called on a thread it
would get interrupted immediately, so what's going on?
Thanks,
Ven
On 02/02/2011 08:12 AM, Eric J. Holtman wrote:
> On 2/2/2011 2:33 AM, Viatcheslav.Sysoltsev_at_[hidden] wrote:
>
>> boost::thread is quite simple component, just start your code in
>> debugger and see where it fails. What's the point to guess if you don't
>> provide details
>>
> Yeah, nothing like adding in a debugger to change the
> race conditions and hide your bugs.
>
> If there's one word I would *not* use in reference to
> anything multi-threaded, it's "simple".
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
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