1997Q3/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev] Multi&#45;threaded programming under Linux -->
<!--X-From-R13: Aevba Vrael <buraelNfqpp10.hpfq.rqh> -->
<!--X-Date: from scipio.globecomm.net [207.51.48.12] by in4.ibm.net id 869683790.57758&#45;1 Wed Jul 23 18:49:50 1997 CUT -->
<!--X-Message-Id: 199707231849.LAA19994#sdcc10,ucsd.edu -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 199707231551.KAA25480#laurel,actlab.utexas.edu -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev] Multi-threaded programming under Linux</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:ohenry#sdcc10,ucsd.edu">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00228.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00230.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00227.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00233.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00229">Author</A>
&nbsp;|&nbsp;<A HREF="#00229">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00229">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev] Multi-threaded programming under Linux</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A></LI>
<LI><em>Subject</em>: Re: [MUD-Dev] Multi-threaded programming under Linux</LI>
<LI><em>From</em>: Orion Henry &lt;<A HREF="mailto:ohenry#sdcc10,ucsd.edu">ohenry#sdcc10,ucsd.edu</A>&gt;</LI>
<LI><em>Date</em>: Wed, 23 Jul 1997 11:49:44 -0700 (PDT)</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:ohenry#ucsd,edu">ohenry#ucsd,edu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>

Hrmmm,
	I am neck deep in trying to get LinuxThreads to work
at my Job.  They seemed to function fine until I put them to 
some serious stress testing.  If anyone else has LinuxThreads
on their box I'd appricate it if they could compile and run
this little bit.  I have no way of knowing if this is the
thread package messing up or if its something else totally
unrelated (like me having the wrong libs)



If this DOES run on someone elses machine please let me know
what spec you are running with.



I am running Redhat linux 4.2
I am runnign binutils 2.8.1
and have glibc 2.0.4 (aka libc 6.0.4 I think)
and I have gcc 2.7.2.1




heres the code

#include &lt;time.h&gt;
#include &lt;stdio.h&gt;
#include &lt;unistd.h&gt;
#include &lt;pthread.h&gt;

#define NUM_THREADS	500


void * slave(void * s)
{
	sleep(1);
	return NULL;
}

int main(int argc, char ** argv)
{
	int i;
	pthread_t slave_t[NUM_THREADS];

	for(i = 0; i &lt; NUM_THREADS;i++)
		pthread_create(&amp;slave_t[i],NULL,slave,NULL);

	for(i = 0; i &lt; NUM_THREADS;i++) {
		pthread_join(slave_t[i],NULL);
		printf("[PARENT] Slave %d is dead.\n",i);
		fflush(0);
		}

	printf("All done...\n");

	return 0;
}



heres the output



[PARENT] Slave 0 is dead.
[PARENT] Slave 1 is dead.
[PARENT] Slave 2 is dead.
[PARENT] Slave 3 is dead.
[PARENT] Slave 4 is dead.
[PARENT] Slave 5 is dead.
...
...
...
[PARENT] Slave 246 is dead.
[PARENT] Slave 247 is dead.
[PARENT] Slave 248 is dead.
[PARENT] Slave 249 is dead.
[PARENT] Slave 250 is dead.
[PARENT] Slave 251 is dead.
Segmentation Fault


Last week it would always die after 246... 
this week it always dies after 251...


If anyone can duplicate this crash (or not)
I'd be quite happy.


	Thanks,
	Orion


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="00241" HREF="msg00241.html">Re: [MUD-Dev] Multi-threaded programming under Linux</A></strong>
<ul compact><li><em>From:</em> Michael Hohensee &lt;michael#mainstream,net&gt;</li></ul>
<li><strong><A NAME="00233" HREF="msg00233.html">Re: [MUD-Dev] OT: Multi-threaded programming under Linux</A></strong>
<ul compact><li><em>From:</em> coder#ibm,net</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00227" HREF="msg00227.html">[MUD-Dev] Multi-threaded programming under Linux</A></STRONG>
<UL><LI><EM>From:</EM> Cynbe ru Taren &lt;cynbe#laurel,actlab.utexas.edu&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00228.html">Re: [MUD-Dev]  C&amp;C and Event Rescheduling</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00230.html">Re: [MUD-Dev]  Multi-threaded programming under Linux</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00227.html">[MUD-Dev] Multi-threaded programming under Linux</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00233.html">Re: [MUD-Dev] OT: Multi-threaded programming under Linux</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00229"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00229"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>Re: [MUD-Dev] Motivating people</STRONG>, <EM>(continued)</EM>
<ul compact>
<LI><strong><A NAME="00259" HREF="msg00259.html">Re: [MUD-Dev] Motivating people</A></strong>, 
clawrenc <a href="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</a>, Tue 29 Jul 1997, 12:17 GMT
</LI>
</ul>
</LI>
<LI><strong><A NAME="00234" HREF="msg00234.html">Motivating people</A></strong>, 
Greg Munt <a href="mailto:greg#uni-corn,demon.co.uk">greg#uni-corn,demon.co.uk</a>, Fri 25 Jul 1997, 01:39 GMT
<UL>
<LI><strong><A NAME="00258" HREF="msg00258.html">Re: [MUD-Dev]  Motivating people</A></strong>, 
clawrenc <a href="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</a>, Tue 29 Jul 1997, 10:09 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00227" HREF="msg00227.html">[MUD-Dev] Multi-threaded programming under Linux</A></strong>, 
Cynbe ru Taren <a href="mailto:cynbe#laurel,actlab.utexas.edu">cynbe#laurel,actlab.utexas.edu</a>, Wed 23 Jul 1997, 22:51 GMT
<UL>
<LI><strong><A NAME="00229" HREF="msg00229.html">Re: [MUD-Dev] Multi-threaded programming under Linux</A></strong>, 
Orion Henry <a href="mailto:ohenry#sdcc10,ucsd.edu">ohenry#sdcc10,ucsd.edu</a>, Thu 24 Jul 1997, 01:49 GMT
<UL>
<LI><strong><A NAME="00233" HREF="msg00233.html">Re: [MUD-Dev] OT: Multi-threaded programming under Linux</A></strong>, 
coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Thu 24 Jul 1997, 12:26 GMT
</LI>
<LI><strong><A NAME="00241" HREF="msg00241.html">Re: [MUD-Dev] Multi-threaded programming under Linux</A></strong>, 
Michael Hohensee <a href="mailto:michael#mainstream,net">michael#mainstream,net</a>, Fri 25 Jul 1997, 22:45 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><strong><A NAME="00224" HREF="msg00224.html">Re: [MUD-Dev]	Multi-threaded programming under Linux</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Wed 23 Jul 1997, 13:05 GMT
<UL>
<LI><strong><A NAME="00225" HREF="msg00225.html">Re: [MUD-Dev] Multi-threaded programming under Linux</A></strong>, 
Jeff Kesselman <a href="mailto:jeffk#tenetwork,com">jeffk#tenetwork,com</a>, Wed 23 Jul 1997, 13:18 GMT
</LI>
</UL>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>