Boost logo

Boost Users :

Subject: Re: [Boost-users] How to detect thread kill?
From: Samvel Khalatyan (samvel.khalatyan_at_[hidden])
Date: 2011-09-02 11:21:05


Dear Rune,

Thanks for the trick. However, this solution may lead to some sort of extra
delay, b/c manager of the threads has to wait for certain time before it can
make assumption that thread was killed.

I am looking for the "catch-kill" solution.

Regards

On Wed, Aug 31, 2011 at 3:32 PM, Rune Lund Olesen <rune.olesen_at_[hidden]>wrote:

> You could make a structure on the heap to track which threads you kill
> yourself and which you think is alive - i imagine.
> Each thread should then update said structure when done (in a
> threadsafe way needless to say).
> If a thread then is gone and your tracker thinks its alive you can
> conclude something else killed it -almost in a portable way i guess.
>
> Regards
>
>
> On Wed, Aug 31, 2011 at 7:19 PM, Samvel Khalatyan
> <samvel.khalatyan_at_[hidden]> wrote:
> > Thank you Chris.
> > I have an application that starts many threads to process input files.
> The
> > application runs on Linux and sometimes threads get killed. This leads to
> > segmentation faults and termination without memory clean-up, etc. So, I
> > thought of the way to at least catch such cases and cleanly quit the
> > application.
> > Samvel.
> > On Wed, Aug 31, 2011 at 11:52 AM, Chris Cleeland <
> chris.cleeland_at_[hidden]>
> > wrote:
> >>
> >> On Wed, Aug 31, 2011 at 11:03 AM, Samvel Khalatyan
> >> <samvel.khalatyan_at_[hidden]> wrote:
> >> > There is a number of standard ways to interrupt thread from within an
> >> > application with library tools.
> >>
> >> Not in a portable fashion.
> >>
> >> > However, is there a way to detect if one of the running threads was
> >> > killed
> >> > with system tools and thread is not available any more?
> >>
> >> I'm not aware of any consistent way of killing a thread with system
> tools.
> >>
> >> Since there is no portable way to do what you're asking, I can't
> >> imagine that there's a portable way to detect the effect, either.
> >> _______________________________________________
> >> Boost-users mailing list
> >> Boost-users_at_[hidden]
> >> http://lists.boost.org/mailman/listinfo.cgi/boost-users
> >
> >
> > _______________________________________________
> > Boost-users mailing list
> > Boost-users_at_[hidden]
> > http://lists.boost.org/mailman/listinfo.cgi/boost-users
> >
> _______________________________________________
> 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