🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #15282

Re: Mutex and WaitForSingleObject Problem...

#15282
From: Colin Maharaj
Date: Tue, 15 Jul 2003 10:15
31 lines
2079 bytes
For the record thanks again.....
> 
> With that said, you should also not be creating/opening the mutex everything
> time you want to wait on it, either.  You should be creating it *once* at
> the very beginning and then reusing it over and over for the lifetime of the
> thread or data (depending on your design), only closing it onoce you're
> actually finished with it.
> 
> Gambit

The idea above did cross my mind....

Finally, the app that creates the file will have to be the initial
owner, and the consumer, the 
one to request access but not ownership. 

like this....right???
CREATOR  APP: CreateMutex ( NULL, TRUE, "PmsiBinAccess");
CONSUMER APP: CreateMutex ( NULL, FALSE, "PmsiBinAccess");

The consumer app is just waiting to rename the file, then consume it.
Is there anything else I would need to consider on the consumer side of
things?

[PS: sorry about sending to your email - not my intention]


Thanks again!!

Colin B Maharaj
Trinidad, WI.
Technical Details
Message-ID: <3F13D446.FE380393@cablenett.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-09!supernews.com!38.144.126.70.MISMATCH!feed3.newsreader.com!newsreader.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3F135784.B6BE9C00@cablenett.net> <3f136552$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,4b66d79a94ed9589
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-07-15 03:31:51 PST
Message-ID: <3F13D446.FE380393@cablenett.net>
Date: Tue, 15 Jul 2003 06:15:34 -0400
From: Colin Maharaj <cbm@cablenett.net>
Reply-To: cbm@cablenett.net
X-Mailer: Mozilla 4.78 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Mutex and WaitForSingleObject Problem...
References: <3F135784.B6BE9C00@cablenett.net> <3f136552$1@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 196.32.37.72
X-Trace: newsgroups.borland.com 1058264381 196.32.37.72 (15 Jul 2003 03:19:41 -0700)
Lines: 31
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-09!supernews.com!38.144.126.70.MISMATCH!feed3.newsreader.com!newsreader.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail