From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ffc1e,870f39ca0a91dafa X-Google-Attributes: gidffc1e,public X-Google-Thread: 109fba,870f39ca0a91dafa X-Google-Attributes: gid109fba,public X-Google-Thread: fc89c,870f39ca0a91dafa X-Google-Attributes: gidfc89c,public X-Google-Thread: fee84,870f39ca0a91dafa X-Google-Attributes: gidfee84,public X-Google-Thread: 1108a1,870f39ca0a91dafa X-Google-Attributes: gid1108a1,public From: David Brownell Subject: Re: Looking for best design for using pthreads in C++ objects Date: 1996/03/06 Message-ID: <313DE7CF.7AF1@ix.netcom.com>#1/1 X-Deja-AN: 142085618 references: <3128ff8b.666031216@news.clark.net> <312A0E5F.7B2C@ix.netcom.com> content-type: text/plain; charset=us-ascii organization: Dave's VAX x-netcom-date: Wed Mar 06 11:34:11 AM PST 1996 mime-version: 1.0 newsgroups: comp.programming.threads,comp.lang.c++,comp.unix.osf.osf1,comp.unix.programmer,comp.object x-mailer: Mozilla 2.0 (Win95; I) 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