From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit 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: ffc1e,870f39ca0a91dafa X-Google-Attributes: gidffc1e,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/08 Message-ID: <31407AAD.1CEF@ix.netcom.com>#1/1 X-Deja-AN: 142177582 references: <3128ff8b.666031216@news.clark.net> <312A0E5F.7B2C@ix.netcom.com> <31320705.41C6@zko.dec.com> <313DEF19.5B69@ix.netcom.com> <313EDB0B.FF6@zko.dec.com> cc: brownell@ix.netcom.com content-type: text/plain; charset=us-ascii organization: Dave's VAX x-netcom-date: Fri Mar 08 12:27:56 PM CST 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) Dave Butenhof wrote: > Having classes with destructors that clean up state, as TRIVIALLY > DEMONSTRATED by Locker, is clearly the best way to apply C++ semantics to > the problem of protecting thread state invariants against "unusual" > routine exit. But the true solution in nearly all cases must go beyond > the triviality of Locker to restore data invariants, not merely the state > of the mutex! So I guess we all agree. The original question was a pretty vague one, and my response was therefore generic. When you apply generic techniques, a "cookbook" approach doesn't work. I did what I could to make that clear, but in the discussion all of the original context was lost. Part of the peril of being taken out of context! -- David Brownell