Article View: borland.public.cppbuilder.nativeapi
Article #14435Re: MUTEX Objects
From: Rodolfo Frino
Date: Thu, 14 Aug 2003 05:09
Date: Thu, 14 Aug 2003 05:09
35 lines
2228 bytes
2228 bytes
It is difficult to diagnose the problem you are experiencing without looking at the actual code. Could you please post the minimal example that reproduces the problem? Having said that, one posibility is that one of your threads terminates without releasing the ownership of a mutex object and therefore the mutex becomes abandoned. Another thread (that is waiting) can get ownership of the abandoned mutex, *This is what could be happening in your application* however the wait function that you use to request ownership will return WAIT_ABANDONED. Whe a mutex is abandoned, the code the mutex is suppose to protect will be in an undefined state Rodolfo "PaulMac" <machiave@i-stat.com> wrote in message news:3f3a81c8@newsgroups.borland.com... > In using MUTEX objects, I came across something unexpected. Given a Windows > GUI app and a Service app, if the same named MUTEX is accessed, both > applications can acquire it when the other has already done so. However, if > both applications are service apps or both are GUI apps, then the proper > synchronization occurs. > > It has been my understanding that MUTEXes, being kernel objects, are > "global" to a system. So, why am I seeing this behavior? > > Paul Mac > >
Technical Details
Message-ID:
<3f3b1976@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3f3a81c8@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,1fbb91fdbd389c0b X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-08-13 22:33:29 PST From: "Rodolfo Frino" <rodolfofrino@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f3a81c8@newsgroups.borland.com> Subject: Re: MUTEX Objects Date: Thu, 14 Aug 2003 15:09:47 +1000 Lines: 37 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 203.206.27.14 Message-ID: <3f3b1976@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1060837750 203.206.27.14 (13 Aug 2003 22:09:10 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail