The WaitForMultipleObjects correctly returns when all threads have exited as
long as the threads are less than 65. Once I spawn 65 or more, the
WaitForMultipleObjects returns immediately as if every handle was signaled
but the threads still have not finished which I verified. Is this a big in
WaitForMultipleObjects? Thanks.
Prepare for "off-topic" flames.
"Henry" <hl...@ncommand.net> wrote in message
news:OQ3lbaRcAHA.1924@tkmsftngp05...
"Jason Terando" <jasont_...@rapidtext.com> wrote in message
news:egj5PiRcAHA.2216@tkmsftngp02...
"Henry" <hl...@ncommand.net> wrote in message
news:O6IQqEScAHA.1956@tkmsftngp05...
This is the upper limit. Jeffrey Richter has an article in MSJ about this
topic and solution. Unfortunately I cannot find it. Someone else will help?
Regards, Jan
--
Jan Bares
(remove no.spam from my email address)
JPCAD Graphics Engine developer, surf to http://www.antek.cz
"Henry" <hl...@ncommand.net> wrote in message
news:OQ3lbaRcAHA.1924@tkmsftngp05...
"Jan Bares" <jan....@antek.cz.no.spam> wrote in message
news:udcy2EYcAHA.2108@tkmsftngp05...
/henry
"Jason Terando" <jasont_...@rapidtext.com> wrote in message
news:OHB2S3bcAHA.452@tkmsftngp02...
"Henry" <hl...@ncommand.net> wrote in message
news:u2jeVwPdAHA.2184@tkmsftngp05...
1. It's not necessary to create an event to signal completion if you use
beginthreadex and wait on the thread handle to terminate. (i.e. it behaves
exactly like your event. It becomes signalled when the thread terminates).
2. The last time I did this, I built a temporary array of 64 handles,
waited on all of those, then did the next 64, until I ran out of handles and
I knew I was done. So, at most, you have n Threads/64 loops to process
(where 'n' is the total number of threads you started). Also you can use
"WaitForSingle..." with a delay of 0 to determine if a particular handle
needs to be waited on at all (i.e. if it's already signalled you don't have
to wait for it.)
HTH
--
Reginald Blue | Opinions expressed here do not
Natural Language Understanding | necessarily represent those of
Unisys Corporation | my employer.
--------------------------------+-------------------------------
For speech technology solutions,| r...@NOSPAM.trsvr.tr.unisys.com
NL technology,speech application| My email address is wrong, you
development training, see: | need to remove the obvious.
http://www.speechdepot.com/ +-------------------------------
"Henry" <hl...@ncommand.net> wrote in message
news:u2jeVwPdAHA.2184@tkmsftngp05...
> Thanks for the help Jason. You're right about using a counter. I used to
> do that but did not want to have to write a polling routine to constantly
> check for the counter to become zero. I guess I have to. Thanks.