<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[WaitForMultipleObjects]]></title><description><![CDATA[<p>hi, ich hab mir nen Buch zu Multithreaded Programming gekauft <a href="http://www.amazon.de/Windows-Multithreading-mit-C%2b%2b-Sharp/dp/3826609891/ref=sr_11_1/028-1040135-1350137?ie=UTF8" rel="nofollow">http://www.amazon.de/Windows-Multithreading-mit-C%2B%2B-Sharp/dp/3826609891/ref=sr_11_1/028-1040135-1350137?ie=UTF8</a></p>
<p>hab da nun eine frage zu einem Listing<br />
da taucht dann</p>
<pre><code class="language-cpp">HANDLE hThread[4];
		for (int i = 0; i &lt; thread_number; ++i)
		{
			unsigned int id;
			hThread[i] = reinterpret_cast&lt;HANDLE&gt;	\
				(_beginthreadex(NULL,0,PrimEx,&amp;info,0,&amp;id)); 
		}

		// Mechanismus, um auf den letzten Thread zu warten:
		WaitForMultipleObjects(2, hThread,  TRUE, INFINITE);
</code></pre>
<p>auf</p>
<p>ich wunder mich jetzt vorallem über die 2 bei WaitForMultipleObjects. Zum einen ist</p>
<pre><code class="language-cpp">thread_number = 4;
</code></pre>
<p>und man sollte ja eigentlich anstelle der 2 thread_number da hin schreiben oder?<br />
hab ich was falsch verstanden oder hab ich recht?</p>
<p>danke euch</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/162422/waitformultipleobjects</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Jul 2026 03:53:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/162422.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 18 Oct 2006 11:46:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to WaitForMultipleObjects on Wed, 18 Oct 2006 11:47:29 GMT]]></title><description><![CDATA[<p>hi, ich hab mir nen Buch zu Multithreaded Programming gekauft <a href="http://www.amazon.de/Windows-Multithreading-mit-C%2b%2b-Sharp/dp/3826609891/ref=sr_11_1/028-1040135-1350137?ie=UTF8" rel="nofollow">http://www.amazon.de/Windows-Multithreading-mit-C%2B%2B-Sharp/dp/3826609891/ref=sr_11_1/028-1040135-1350137?ie=UTF8</a></p>
<p>hab da nun eine frage zu einem Listing<br />
da taucht dann</p>
<pre><code class="language-cpp">HANDLE hThread[4];
		for (int i = 0; i &lt; thread_number; ++i)
		{
			unsigned int id;
			hThread[i] = reinterpret_cast&lt;HANDLE&gt;	\
				(_beginthreadex(NULL,0,PrimEx,&amp;info,0,&amp;id)); 
		}

		// Mechanismus, um auf den letzten Thread zu warten:
		WaitForMultipleObjects(2, hThread,  TRUE, INFINITE);
</code></pre>
<p>auf</p>
<p>ich wunder mich jetzt vorallem über die 2 bei WaitForMultipleObjects. Zum einen ist</p>
<pre><code class="language-cpp">thread_number = 4;
</code></pre>
<p>und man sollte ja eigentlich anstelle der 2 thread_number da hin schreiben oder?<br />
hab ich was falsch verstanden oder hab ich recht?</p>
<p>danke euch</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1157011</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1157011</guid><dc:creator><![CDATA[ConfusedGuy]]></dc:creator><pubDate>Wed, 18 Oct 2006 11:47:29 GMT</pubDate></item><item><title><![CDATA[Reply to WaitForMultipleObjects on Wed, 18 Oct 2006 12:15:05 GMT]]></title><description><![CDATA[<p>Du hast recht, da sollte in jedem Fall <em>thread_number</em> stehen.<br />
Außer der Autor wollte nur auf die ersten beiden Threads warten <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f576.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--sunglasses"
      title=":sunglasses:"
      alt="🕶"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1157040</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1157040</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Wed, 18 Oct 2006 12:15:05 GMT</pubDate></item><item><title><![CDATA[Reply to WaitForMultipleObjects on Wed, 18 Oct 2006 17:01:39 GMT]]></title><description><![CDATA[<p>naja, es gibt im buch noch nen beispiel wie das ganze mit c# aussehen würde. da steht natürlich thread_number...</p>
<p>aber gut zu wissen das ich was verstanden hab. danke dir</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1157231</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1157231</guid><dc:creator><![CDATA[ConfusedGuy]]></dc:creator><pubDate>Wed, 18 Oct 2006 17:01:39 GMT</pubDate></item></channel></rss>