This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: catch(...) and forced unwind
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Richard Henderson <rth at redhat dot com>, David Abrahams <dave at boost-consulting dot com>, Jason Merrill <jason at redhat dot com>, Matt Austern <austern at apple dot com>, Ulrich Drepper <drepper at redhat dot com>, gcc at gcc dot gnu dot org, Nathan Myers <ncm at cantrip dot org>, wekempf at cox dot net, fjh at cs dot mu dot oz dot au, Benjamin Kosnik <bkoz at redhat dot com>
- Date: Wed, 17 Dec 2003 14:43:42 -0800
- Subject: Re: catch(...) and forced unwind
- Organization: CodeSourcery, LLC
- References: <xypd6aoi0zz.fsf@miranda.boston.redhat.com> <1071632782.3793.114.camel@minax.codesourcery.com> <u4qvz8zae.fsf@boost-consulting.com> <1071678864.4082.22.camel@minax.codesourcery.com> <u3cbjmlgc.fsf@boost-consulting.com> <1071681263.4082.30.camel@minax.codesourcery.com> <uk74vjo92.fsf@boost-consulting.com> <1071686175.21686.9.camel@doubledemon.codesourcery.com> <20031217203056.GB4680@redhat.com> <1071696033.21681.22.camel@doubledemon.codesourcery.com> <20031217192555.GY12344@sunsite.ms.mff.cuni.cz>
- Reply-to: mark at codesourcery dot com
On Wed, 2003-12-17 at 11:25, Jakub Jelinek wrote:
> On Wed, Dec 17, 2003 at 01:20:33PM -0800, Mark Mitchell wrote:
> > On Wed, 2003-12-17 at 12:30, Richard Henderson wrote:
> > > On Wed, Dec 17, 2003 at 10:36:15AM -0800, Mark Mitchell wrote:
> > > > That would also be a POSIX threads extension; essentially, this would be
> > > > the deferred cancellation model, except that pthread_testcancel would be
> > > > the only cancellation point.
> > >
> > > I would think that disabling cancellation and then using testcancel
> > > would be equivalent.
> >
> > I don't think so; pthread_setcancelstate (PTHREAD_CANCEL_DISABLE) means
> > that the thread will not receive cancellation requests at all.
>
> No. PTHREAD_CANCEL_DISABLE means that cancellation requests are queued.
> See http://www.opengroup.org/onlinepubs/007904975/functions/xsh_chap02_09.html#tag_02_09_05_01
Ah.
That was not clear to me from the GNU/Linux info files, but I should
have gone to the source.
Given that, I agree with you and Richard: David's alternative is
equivalent to just disabling cancellation, and then using
pthread_testcancel at appropriate points. No additional
compiler/library support is required to implement that model.
Thanks,
--
Mark Mitchell <mark@codesourcery.com>
CodeSourcery, LLC