From: David Brownell <brownell@ix.netcom.com>
Subject: Re: Looking for best design for using pthreads in C++ objects
Date: 1996/03/06 [thread overview]
Message-ID: <313DE7CF.7AF1@ix.netcom.com> (raw)
In-Reply-To: 312A0E5F.7B2C@ix.netcom.com
Webb Scales wrote:
>
> Harald Fuchs wrote:
> > It's simply too easy to forget an appropriate catch clause.
... but if you have viable thread support from your C++ system,
that'll never be an issue. That was a premise in my original
posting, as I recall: the C++ exception runtime interacts in
the natural way with the POSIX cancellation interface (i.e. the
destructors are the C++ version of the C "cleanup handlers").
Admittedly POSIX.1c doesn't have a C++ binding yet. But the
rationale makes clear what's intended: use the language's
native exception handling facilities to handle cancellation.
> But, that's my point exactly! If it's easy to forget the catch clause,
> then it is even easier to forget to rectify the state of the shared
> data.
These go together in all good MT-aware programming styles, just like
policies like "mutex state isn't changed by function calls". As with
all style guidelines, they can be broken if you know what you're doing;
I tend to call that "rocket science mode".
- Dave
prev parent reply other threads:[~1996-03-06 5:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-02-19 5:00 Looking for best design for using pthreads in C++ objects Thom Anderson
1996-02-20 5:00 ` Nasser Abbasi
1996-02-20 5:00 ` David Brownell
1996-02-26 5:00 ` Webb Scales
[not found] ` <313DEF19.5B69@ix.netcom.com>
[not found] ` <313EDB0B.FF6@zko.dec.com>
1996-03-08 5:00 ` David Brownell
1996-02-27 5:00 ` Harald Fuchs
1996-02-28 5:00 ` Webb Scales
1996-03-06 5:00 ` David Brownell [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox