Boost logo

Boost Users :

Subject: Re: [Boost-users] Thread changes from Boost 1.38 to 1.45
From: Viatcheslav.Sysoltsev_at_[hidden]
Date: 2011-02-08 04:19:25


> 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:

Umm, not sure if I got you correctly: you mean one of your thread waits in
condition_variable_any::timed_wait() and second tries to interrupt it,
which just does not seem to make any effect? Can you write a small test
case demonstrating your problem?

>
> 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?
>

The behavior was always such, the interrupt works only for predefined
points. No signal black magick here ;)

-- Slava


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