apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garrett Rooney" <roo...@electricjellyfish.net>
Subject Re: Does or will APR support thread cancellation?
Date Mon, 22 May 2006 21:08:51 GMT
On 5/22/06, Peter N. Lundblad <peter@famlundblad.se> wrote:
> Greg Stein writes:
>  > On 5/22/06, Garrett Rooney <rooneg@electricjellyfish.net> wrote:
>  > > On 5/19/06, Weihan Wang <w23wang@uwaterloo.ca> wrote:
>  > > > Hi,
>  > > >
>  > > > I didn't see thread cancellation API but did see some code segments of
>  > > > APR that intend to implement it. Will APR API support cancellation in
>  > > > the near future? Thanks.
>  > >
>  > > I don't know of anyone working on such a feature for APR.
>  >
>  > Right. Generally, cancellation is considered very unsafe. Most APIs
>  > nowadays do not support it.
>  >
> Does this also apply to synchronous cancelation?

Define "synchronous cancelation".

In my experience, anything that goes out and kills a thread without
giving it a chance to clean up (and
pthread_cleanup_push/pthread_cleanup_pop don't count, IMO) is a bad
thing.  If you need the ability to cancel a running thread you should
be setting up a way to communicate to the thread that it should exit,
and letting it do so.

-garrett

-garrett

Mime
View raw message