🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Wait for "signal" from another application and/or thread

#8986
From: Bob Gonder
Date: Sat, 14 Aug 2004 01:32
11 lines
1529 bytes
<zoom> wrote:

>What I want in my code is to allow every thread to iterate once when event
>is set.

Then don't reset the event from inside your thread. When you reset it,
it stops waking up threads.

Or use semaphore (See CreateSemaphore() ) as Eugene suggests.
Then, instead of SetEvent(), you would use ReleaseSemaphore() with a
count of how many threads you want to wake up.
Technical Details
Message-ID: <ekqqh09rj9qbi7ks4v31c89kurejmgnoln@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4105617c$1@newsgroups.borland.com> <4105777f$3@newsgroups.borland.com> <411ccf89@newsgroups.borland.com> <gnsph0pq4c8mfhapah6cideqmbp6gqor5r@4ax.com> <411cfd09@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,b6552239fe09c315
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Wait for "signal" from another application and/or thread 
Date: Fri, 13 Aug 2004 18:32:55 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <ekqqh09rj9qbi7ks4v31c89kurejmgnoln@4ax.com>
References: <4105617c$1@newsgroups.borland.com> <4105777f$3@newsgroups.borland.com> <411ccf89@newsgroups.borland.com> <gnsph0pq4c8mfhapah6cideqmbp6gqor5r@4ax.com> <411cfd09@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 65.40.118.193
X-Trace: newsgroups.borland.com 1092447172 65.40.118.193 (13 Aug 2004 18:32:52 -0700)
Lines: 13
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail