1998Q2/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Re: Technical C/C++ coding question -->
<!--X-From-R13: X Q Znjerapr <pynjNxnatn.ah> -->
<!--X-Date: Sun, 14 Jun 1998 07:57:43 &#45;0700 -->
<!--X-Message-Id: E0ylEE3&#45;0007Cc&#45;00#mail,kanga.nu -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: Pine.LNX.3.93.980614003341.7041A&#45;100000#the486,bradley.edu -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] Re: Technical C/C++ coding question</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:claw#kanga,nu">
</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="msg01033.html">Previous</a>
&nbsp;|&nbsp;<a href="msg01035.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg01023.html">Previous</a>
&nbsp;|&nbsp;<a href="msg01088.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#01034">Author</A>
&nbsp;|&nbsp;<A HREF="#01034">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#01034">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] Re: Technical C/C++ coding question</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Subject</em>: [MUD-Dev] Re: Technical C/C++ coding question </LI>
<LI><em>From</em>: J C Lawrence &lt;<A HREF="mailto:claw#kanga,nu">claw#kanga,nu</A>&gt;</LI>
<LI><em>Date</em>: Sun, 14 Jun 1998 07:57:38 -0700</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
On Sun, 14 Jun 1998 00:39:06 -0500 (CDT) 
Katrina McClelan&lt;kitkat#the486,bradley.edu&gt; wrote:

&gt; 	if(!fork()) { /* child copy starts here */
&gt;         kill(getpid(),SIGSEGV); /* this'll dump core */ 
&gt;         sleep(10); /* make sure it stops here */ 
&gt;         /* dead by here */ 
&gt;       }
&gt; 	/* parent continues unaware */

  1) No, you are not even slightly guaranteed that the child will have
fully exited/cored by the end of the sleep.  Process schedulers are
funny that way.  Call waitpid().  Be prepared for the child to have
already exited and to have left the process table by the time
waitpid() is run in the parent (WNOWAIT).  

  2) Check for failure of the fork() and retry if needed.  On
healthily running systems, fork() may well fail due to contention at
the process table spinlock.  The Kernel will throw an error rather
than queue the requests and guarantee success (common design decision
for SMP kernels).  You should account for this.  

  3) You'd get slightly cleaner results if the child just immediately
hung an alarm() and the parent killed the child.

-- 
J C Lawrence                               Internet: claw#null,net
----------(*)                              Internet: coder#ibm,net
...Honourary Member of Clan McFud -- Teamer's Avenging Monolith...


</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="01088" HREF="msg01088.html">[MUD-Dev] Re: Technical C/C++ coding question</A></strong>
<ul compact><li><em>From:</em> Jon Leonard &lt;jleonard#divcom,slimy.com&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="01023" HREF="msg01023.html">[MUD-Dev] Re: Technical C/C++ coding question</A></STRONG>
<UL><LI><EM>From:</EM> Katrina McClelan &lt;kitkat#the486,bradley.edu&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg01033.html">[MUD-Dev] Re:Telepathy Rules</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg01035.html">[MUD-Dev] Re: darkness/visibility</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg01023.html">[MUD-Dev] Re: Technical C/C++ coding question</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg01088.html">[MUD-Dev] Re: Technical C/C++ coding question</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#01034"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#01034"><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>[MUD-Dev] Re: Off topic! But please help</STRONG>, <EM>(continued)</EM>
<ul compact>
<LI><strong><A NAME="00988" HREF="msg00988.html">[MUD-Dev] Re: Off topic! But please help</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Fri 12 Jun 1998, 00:26 GMT
</LI>
<LI><strong><A NAME="01020" HREF="msg01020.html">[MUD-Dev] Re: Off topic! But please help</A></strong>, 
John Bertoglio <a href="mailto:alexb#internetcds,com">alexb#internetcds,com</a>, Sun 14 Jun 1998, 05:09 GMT
<UL>
<LI><strong><A NAME="01021" HREF="msg01021.html">[MUD-Dev] Technical C/C++ coding question</A></strong>, 
Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Sun 14 Jun 1998, 05:45 GMT
<UL>
<LI><strong><A NAME="01023" HREF="msg01023.html">[MUD-Dev] Re: Technical C/C++ coding question</A></strong>, 
Katrina McClelan <a href="mailto:kitkat#the486,bradley.edu">kitkat#the486,bradley.edu</a>, Sun 14 Jun 1998, 06:52 GMT
<UL>
<LI><strong><A NAME="01034" HREF="msg01034.html">[MUD-Dev] Re: Technical C/C++ coding question</A></strong>, 
J C Lawrence <a href="mailto:claw#kanga,nu">claw#kanga,nu</a>, Sun 14 Jun 1998, 14:57 GMT
<UL>
<LI><strong><A NAME="01088" HREF="msg01088.html">[MUD-Dev] Re: Technical C/C++ coding question</A></strong>, 
Jon Leonard <a href="mailto:jleonard#divcom,slimy.com">jleonard#divcom,slimy.com</a>, Tue 16 Jun 1998, 23:52 GMT
<UL>
<LI><strong><A NAME="01089" HREF="msg01089.html">[MUD-Dev] Re: Technical C/C++ coding question</A></strong>, 
Katrina McClelan <a href="mailto:kitkat#the486,bradley.edu">kitkat#the486,bradley.edu</a>, Wed 17 Jun 1998, 00:34 GMT
<UL>
<LI><strong><A NAME="01091" HREF="msg01091.html">[MUD-Dev] Re: Technical C/C++ coding question</A></strong>, 
Jon Leonard <a href="mailto:jleonard#divcom,slimy.com">jleonard#divcom,slimy.com</a>, Wed 17 Jun 1998, 01:36 GMT
<UL>
<LI><strong><A NAME="01092" HREF="msg01092.html">[MUD-Dev] Re: Technical C/C++ coding question</A></strong>, 
Katrina McClelan <a href="mailto:kitkat#the486,bradley.edu">kitkat#the486,bradley.edu</a>, Wed 17 Jun 1998, 01:50 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</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>