From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit 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 X-Google-Thread: 109fba,870f39ca0a91dafa X-Google-Attributes: gid109fba,public From: Webb Scales Subject: Re: Looking for best design for using pthreads in C++ objects Date: 1996/02/28 Message-ID: <3134F4F5.167E@zko.dec.com>#1/1 X-Deja-AN: 142287837 references: <3128ff8b.666031216@news.clark.net> <312A0E5F.7B2C@ix.netcom.com> content-type: text/plain; charset=us-ascii organization: Digital Equipment Corporation, DECthreads 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 (X11; I; OSF1 V3.2 alpha) Harald Fuchs wrote: > It's simply too easy to forget an appropriate catch clause. 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. If you fail to unlock the mutex, your application will soon deadlock, which will make it obvious that something is wrong and which will suggest areas to examine; on the other hand, if the mutex is silently unlocked, then the problem my not surface until another thread at some distance away in the code attempts to use the shared data, and, at that point, all indications of the source of the problem are gone. ------------------------------------------------------------------------ Webb Scales Digital Equipment Corporation scales@wtfn.enet.dec.com 110 Spit Brook Rd, ZKO2-3/Q18 Voice: 603.881.2196, FAX: 603.881.0120 Nashua, NH 03062-2711 Rule #12: Be joyful -- seek the joy of being alive. ------------------------------------------------------------------------