<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://programmingexamples.net/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://programmingexamples.net/w/index.php?action=history&amp;feed=atom&amp;title=CPP%2FPThreads</id>
		<title>CPP/PThreads - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://programmingexamples.net/w/index.php?action=history&amp;feed=atom&amp;title=CPP%2FPThreads"/>
		<link rel="alternate" type="text/html" href="http://programmingexamples.net/w/index.php?title=CPP/PThreads&amp;action=history"/>
		<updated>2026-11-02T09:06:43Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.5</generator>

	<entry>
		<id>http://programmingexamples.net/w/index.php?title=CPP/PThreads&amp;diff=352&amp;oldid=prev</id>
		<title>Daviddoria: Created page with '==PThreads.cpp== &lt;source lang=&quot;cpp&quot;&gt; #include &lt;iostream&gt; #include &lt;pthread.h&gt; #include &lt;cstdlib&gt;  using namespace std;  void *task(void *arg)  { 	for (unsigned int i = 0; i &lt; 1e3…'</title>
		<link rel="alternate" type="text/html" href="http://programmingexamples.net/w/index.php?title=CPP/PThreads&amp;diff=352&amp;oldid=prev"/>
				<updated>2010-11-23T17:55:28Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;==PThreads.cpp== &amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt; #include &amp;lt;iostream&amp;gt; #include &amp;lt;pthread.h&amp;gt; #include &amp;lt;cstdlib&amp;gt;  using namespace std;  void *task(void *arg)  { 	for (unsigned int i = 0; i &amp;lt; 1e3…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==PThreads.cpp==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;pthread.h&amp;gt;&lt;br /&gt;
#include &amp;lt;cstdlib&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using namespace std;&lt;br /&gt;
&lt;br /&gt;
void *task(void *arg) &lt;br /&gt;
{&lt;br /&gt;
	for (unsigned int i = 0; i &amp;lt; 1e3; i++) &lt;br /&gt;
	{&lt;br /&gt;
		cout &amp;lt;&amp;lt; &amp;quot;running...&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
		//cout.flush();&lt;br /&gt;
	}&lt;br /&gt;
	return NULL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main() &lt;br /&gt;
{&lt;br /&gt;
	pthread_t t1;&lt;br /&gt;
	if ( pthread_create(&amp;amp;t1, NULL, task, (void *)&amp;quot;1&amp;quot;) != 0 ) &lt;br /&gt;
	{&lt;br /&gt;
		cout &amp;lt;&amp;lt; &amp;quot;pthread_create() error&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
		abort();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	//pthread_join(t1, NULL);&lt;br /&gt;
	&lt;br /&gt;
	cout &amp;lt;&amp;lt; &amp;quot;done.&amp;quot; &amp;lt;&amp;lt; endl;&lt;br /&gt;
	&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==CMakeLists.txt==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cmake&amp;quot;&amp;gt;&lt;br /&gt;
cmake_minimum_required(VERSION 2.6)&lt;br /&gt;
&lt;br /&gt;
Project(PThreads)&lt;br /&gt;
&lt;br /&gt;
ADD_EXECUTABLE(PThreads PThreads.cpp)&lt;br /&gt;
TARGET_LINK_LIBRARIES(PThreads pthread)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Daviddoria</name></author>	</entry>

	</feed>