1999Q4/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...) -->
<!--X-From-R13: ptNnzv&#45;pt.UenlEntr.Sqzbagba.OP.QO -->
<!--X-Date: Tue, 28 Dec 1999 09:44:18 &#45;0800 -->
<!--X-Message-Id: 199912281639.JAA08596@ami&#45;cg.GraySage.Edmonton.AB.CA -->
<!--X-Content-Type: text/plain -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting </title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:cg@ami-cg.GraySage.Edmonton.AB.CA">
</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="msg00787.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00790.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00787.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00789.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00788">Author</A>
&nbsp;|&nbsp;<A HREF="#00788">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00788">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</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>: Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</LI>
<LI><em>From</em>: <A HREF="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</A></LI>
<LI><em>Date</em>: Tue, 28 Dec 1999 09:39:06 -0700</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Sender</em>: <A HREF="mailto:mud-dev-admin#kanga,nu">mud-dev-admin#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>
[Hans-Henrik Staerfeldt:]

&gt; Yes, or keep assuming the worst possible. Assume that the thread can be 
&gt; interrupted, after you have written down 16 of 32 bit of any long word 
&gt; in the memory, making the 32-bit value non-valid, which is why you need
&gt; thread-safe system calls :-) I actually had this error, though on older 
&gt; hardware.

As far as I know, that shouldn't be a problem on a 32 bit CPU. The
instructions, if done properly aligned, should be single, atomic instructions.

The rule is likely something like: do not assume atomicity of operations
for any operations which operate on values larger than the word-size of
the machine, or on *any* struct/class values. So, on a 16 bit MC68000,
watch out for 32 bit values - they may not be atomic on memory accesses.
On a 32 bit IA32 (e.g. Pentium) machine, watch out for operations on 64
bit values - they may not be atomic with respect to memory. On a 64 bit
machine, e.g. an Alpha, watch out for 128 bit operations, etc.

There are of course exceptions. I believe newer Pentia have some explicit
64 bit special instructions, and since their off-chip bus width is
sometimes &gt; 32 bits, these can work atomically. Unless you know the
specifics, however, and want your software to not be readily portable to
other CPU variants (even other I32's!), don't assume anything.

-- 
Don't design inefficiency in - it'll happen in the implementation.

Chris Gray     cg#ami-cg,GraySage.Edmonton.AB.CA
               <A  HREF="http://www.GraySage.Edmonton.AB.CA/cg/">http://www.GraySage.Edmonton.AB.CA/cg/</A>



_______________________________________________
MUD-Dev maillist  -  MUD-Dev#kanga,nu
<A  HREF="http://www.kanga.nu/lists/listinfo/mud-dev">http://www.kanga.nu/lists/listinfo/mud-dev</A>

</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="00789" HREF="msg00789.html">Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</A></strong>
<ul compact><li><em>From:</em> Greg Miller &lt;gmiller@classic-games.com&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00787.html">Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00790.html">[MUD-Dev] Embedded languages, object persistance... ack.</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00787.html">Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00789.html">Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00788"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00788"><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] Embedded languages, object persistance... ack.</STRONG>, <EM>(continued)</EM>
<ul compact>
<LI><strong><A NAME="00792" HREF="msg00792.html">Re: [MUD-Dev] Embedded languages, object persistance... ack.</A></strong>, 
Laurent Bossavit <a href="mailto:bossavit@cybercable.fr">bossavit@cybercable.fr</a>, Wed 29 Dec 1999, 22:40 GMT
</LI>
<LI><strong><A NAME="00793" HREF="msg00793.html">Re: [MUD-Dev] Embedded languages, object persistance... ack.</A></strong>, 
cg <a href="mailto:cg@ami-cg.GraySage.Edmonton.AB.CA">cg@ami-cg.GraySage.Edmonton.AB.CA</a>, Thu 30 Dec 1999, 05:09 GMT
</LI>
</ul>
</LI>
<LI><strong><A NAME="00782" HREF="msg00782.html">Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</A></strong>, 
cg <a href="mailto:cg@ami-cg.GraySage.Edmonton.AB.CA">cg@ami-cg.GraySage.Edmonton.AB.CA</a>, Fri 24 Dec 1999, 19:03 GMT
<UL>
<LI><strong><A NAME="00787" HREF="msg00787.html">Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</A></strong>, 
Hans-Henrik Staerfeldt <a href="mailto:hhs@cbs.dtu.dk">hhs@cbs.dtu.dk</a>, Tue 28 Dec 1999, 16:05 GMT
</LI>
</UL>
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00788" HREF="msg00788.html">Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</A></strong>, 
cg <a href="mailto:cg@ami-cg.GraySage.Edmonton.AB.CA">cg@ami-cg.GraySage.Edmonton.AB.CA</a>, Tue 28 Dec 1999, 17:44 GMT
<UL>
<LI><strong><A NAME="00789" HREF="msg00789.html">Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</A></strong>, 
Greg Miller <a href="mailto:gmiller@classic-games.com">gmiller@classic-games.com</a>, Wed 29 Dec 1999, 17:00 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><strong><A NAME="00770" HREF="msg00770.html">[MUD-Dev] Re: MUD-Dev digest, Vol 1 #237 - 9 msgs</A></strong>, 
Dr. Cat <a href="mailto:cat@realtime.net">cat@realtime.net</a>, Thu 23 Dec 1999, 17:13 GMT
<UL>
<LI><strong><A NAME="00783" HREF="msg00783.html">Re: [MUD-Dev] Re: MUD-Dev digest, Vol 1 #237 - 9 msgs</A></strong>, 
J C Lawrence <a href="mailto:claw@kanga.nu">claw@kanga.nu</a>, Fri 24 Dec 1999, 20:13 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00747" HREF="msg00747.html">[MUD-Dev] Job Openings - Mud Engineering</A></strong>, 
Christopher Allen <a href="mailto:ChristopherA@Skotos.net">ChristopherA@Skotos.net</a>, Thu 23 Dec 1999, 01:53 GMT
</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>