<?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[thread funktion mittels event]]></title><description><![CDATA[<p>hi leute!<br />
wie kann ich überprüfen ob eine thread funktion objekt event beendet wurde, außerhalb der thread funktion!!?<br />
auch irgendwie mit WaitForSingleObject ?</p>
<pre><code class="language-cpp">if(WaitForSingleObject(hThread,0)==WAIT_TIMEOUT) 
{ 
   // Thread läuft noch 
} 
else 
{ 
   // Thread läuft nimmer 
}
</code></pre>
<p>so in der art???</p>
<p>cu</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/89356/thread-funktion-mittels-event</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 20:12:20 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/89356.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 18 Oct 2004 23:57:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to thread funktion mittels event on Mon, 18 Oct 2004 23:57:10 GMT]]></title><description><![CDATA[<p>hi leute!<br />
wie kann ich überprüfen ob eine thread funktion objekt event beendet wurde, außerhalb der thread funktion!!?<br />
auch irgendwie mit WaitForSingleObject ?</p>
<pre><code class="language-cpp">if(WaitForSingleObject(hThread,0)==WAIT_TIMEOUT) 
{ 
   // Thread läuft noch 
} 
else 
{ 
   // Thread läuft nimmer 
}
</code></pre>
<p>so in der art???</p>
<p>cu</p>
]]></description><link>https://www.c-plusplus.net/forum/post/632085</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/632085</guid><dc:creator><![CDATA[jasoni]]></dc:creator><pubDate>Mon, 18 Oct 2004 23:57:10 GMT</pubDate></item><item><title><![CDATA[Reply to thread funktion mittels event on Tue, 19 Oct 2004 07:07:11 GMT]]></title><description><![CDATA[<p>Du könntest auch <a href="http://msdn.microsoft.com/library/en-us/dllproc/base/getexitcodethread.asp" rel="nofollow">GetExitCodeThread</a> verwenden <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/632142</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/632142</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Tue, 19 Oct 2004 07:07:11 GMT</pubDate></item><item><title><![CDATA[Reply to thread funktion mittels event on Tue, 19 Oct 2004 14:55:07 GMT]]></title><description><![CDATA[<p>ich hab nun folgendes problem...<br />
ich hab 4 threads!<br />
ich muss im 4ten thread warten das alle anderen 3 threads fertig sind...dann kann ich erst mit den 3 werten weiter rechnen...3 mal WaitForSingleObject?<br />
hab mal wo gesehn man kann das irgendwie in ein array tun...</p>
<p>cu</p>
]]></description><link>https://www.c-plusplus.net/forum/post/632541</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/632541</guid><dc:creator><![CDATA[jasoni]]></dc:creator><pubDate>Tue, 19 Oct 2004 14:55:07 GMT</pubDate></item><item><title><![CDATA[Reply to thread funktion mittels event on Tue, 19 Oct 2004 16:41:40 GMT]]></title><description><![CDATA[<p>WaitForMultipleObjects <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/632644</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/632644</guid><dc:creator><![CDATA[CMatt]]></dc:creator><pubDate>Tue, 19 Oct 2004 16:41:40 GMT</pubDate></item><item><title><![CDATA[Reply to thread funktion mittels event on Fri, 22 Oct 2004 16:37:18 GMT]]></title><description><![CDATA[<p>hi!<br />
ich habs nun mal mit aitForSingleObject probiert!<br />
aber immer bekomm ich das als ergebniss 0 ??? wartet die funktion nicht bis der thread fertig ist??</p>
<pre><code class="language-cpp">#include &lt;process.h&gt;
#include &lt;windows.h&gt;
#include &lt;math.h&gt;
#include &lt;iostream&gt;
using namespace std;

template&lt;class T&gt;

void WaitForReturn(T&amp; stream)
{
	stream.clear();
	stream.ignore(stream.rdbuf()-&gt;in_avail());
	stream.get();
}

void ThreadResult1(void *pX1);

HANDLE h_Event1;
float Y1 = 0.0;

int main()
{  
	float X1 = 0.0;

	cin &gt;&gt; X1;

	h_Event1 = CreateEvent(NULL, FALSE, FALSE, NULL);

	_beginthread(ThreadResult1, 0, (void*) &amp;X1);

	SetEvent(h_Event1);

	WaitForSingleObject(h_Event1, INFINITE); //solange der Thread läuft

	cout &lt;&lt; &quot;Ergebniss: &quot; &lt;&lt; Y1;

	CloseHandle(h_Event1);

	WaitForReturn(cin);

    return 0;
}

void ThreadResult1(void *pX1)
{
    float X1 = 0.0;

	//X1 = static_cast&lt;float&gt;(*pX1);
    X1 = (float) *(float*)pX1;

	Y1 = (X1 * X1 + 2*X1 -3) / log (X1);

	//WaitForSingleObject(h_Event1, INFINITE);

	_endthread();
}
</code></pre>
<p>cu</p>
]]></description><link>https://www.c-plusplus.net/forum/post/635229</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/635229</guid><dc:creator><![CDATA[jasoni]]></dc:creator><pubDate>Fri, 22 Oct 2004 16:37:18 GMT</pubDate></item><item><title><![CDATA[Reply to thread funktion mittels event on Sat, 23 Oct 2004 02:24:47 GMT]]></title><description><![CDATA[<p>Hmmm, hast du gelesen was CMatt schrieb?<br />
Kennst du die (un)logische reihenfolge wie Threads bearbeitet werden?<br />
Brüh mal nen Kaffee auf und zünde ne Zigarette an und leg dich auf die Couch, mit dem Kopf zur decke, und du wirst sehen die Antwort kommt schnell.</p>
<p>Um knapp halb fünf gebe ich nur noch arge Hinweise <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/635481</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/635481</guid><dc:creator><![CDATA[MiC++ha]]></dc:creator><pubDate>Sat, 23 Oct 2004 02:24:47 GMT</pubDate></item><item><title><![CDATA[Reply to thread funktion mittels event on Sat, 23 Oct 2004 04:18:18 GMT]]></title><description><![CDATA[<p>Was soll ich den sagen, ich komme mit meinem code schon um sage und schreibe<br />
viertel nach sechs morgens noch nicht klar. muss um 10 aufstehen und auf eine<br />
schulung...............als trainer! Also ich bin so richtig gef****</p>
<p>Grüße</p>
<p>Ken_The_Coder</p>
]]></description><link>https://www.c-plusplus.net/forum/post/635482</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/635482</guid><dc:creator><![CDATA[Ken_The_Coder]]></dc:creator><pubDate>Sat, 23 Oct 2004 04:18:18 GMT</pubDate></item><item><title><![CDATA[Reply to thread funktion mittels event on Sat, 23 Oct 2004 10:02:32 GMT]]></title><description><![CDATA[<p>Versuch doch mal dem Compiler zu sagen, das Dein Float Y1 auch durch äußere Einflüsse (== Threads) verändert werden darf (mittels volatile).</p>
<p>Sollte das Problem beheben...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/635532</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/635532</guid><dc:creator><![CDATA[Hepi]]></dc:creator><pubDate>Sat, 23 Oct 2004 10:02:32 GMT</pubDate></item><item><title><![CDATA[Reply to thread funktion mittels event on Sat, 23 Oct 2004 10:19:36 GMT]]></title><description><![CDATA[<p>wenn ich nach:</p>
<pre><code class="language-cpp">WaitForSingleObject(h_Event1, INFINITE); //solange der Thread läuft
</code></pre>
<p>ein</p>
<pre><code class="language-cpp">Sleep(100);
</code></pre>
<p>einbaue dann geht es;-)</p>
<p>dachte WaitForSingleObject wartet wirklich bis der thread fertig abgearbeitet ist...</p>
<p>cu</p>
]]></description><link>https://www.c-plusplus.net/forum/post/635544</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/635544</guid><dc:creator><![CDATA[jasoni]]></dc:creator><pubDate>Sat, 23 Oct 2004 10:19:36 GMT</pubDate></item><item><title><![CDATA[Reply to thread funktion mittels event on Sat, 23 Oct 2004 11:21:27 GMT]]></title><description><![CDATA[<p>Tut es auch. Kennst Du die Bedeutung des Schlüsselwortes <strong>volatile</strong>?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/635607</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/635607</guid><dc:creator><![CDATA[Hepi]]></dc:creator><pubDate>Sat, 23 Oct 2004 11:21:27 GMT</pubDate></item><item><title><![CDATA[Reply to thread funktion mittels event on Sat, 23 Oct 2004 17:02:25 GMT]]></title><description><![CDATA[<p>hi!<br />
nö kenn ich bisher noch nicht...</p>
<p>cu</p>
]]></description><link>https://www.c-plusplus.net/forum/post/635903</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/635903</guid><dc:creator><![CDATA[jasoni]]></dc:creator><pubDate>Sat, 23 Oct 2004 17:02:25 GMT</pubDate></item><item><title><![CDATA[Reply to thread funktion mittels event on Sat, 23 Oct 2004 17:07:46 GMT]]></title><description><![CDATA[<p>Dachte ich mir, da Du auf meinen ersten Beitrag überhaupt nicht reagiert hast.</p>
<pre><code class="language-cpp">volatile float Y1 = 0.0;
</code></pre>
<p><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccelng/htm/key_s-z_10.asp" rel="nofollow">MSDN: volatile</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/635909</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/635909</guid><dc:creator><![CDATA[Hepi]]></dc:creator><pubDate>Sat, 23 Oct 2004 17:07:46 GMT</pubDate></item></channel></rss>