msg00241.html

2000Q1/msg00241.html · 9.0 KB

From the archive 2000Q1.zip

Download the archive   « Back to the archive contents

<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev] Question about multithreaded servers -->
<!--X-From-R13: X Q Znjerapr <pynjNxnatn.ah> -->
<!--X-Date: Sun, 30 Jan 2000 11:22:15 &#45;0800 -->
<!--X-Message-Id: E12EzvH&#45;0001oj&#45;00#dingo,kanga.nu -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: Pine.SOL.4.10.10001141100200.5830&#45;100000#earth,execpc.com -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev] Question about multithreaded servers</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="msg00240.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00242.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00087.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00253.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00241">Author</A>
&nbsp;|&nbsp;<A HREF="#00241">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00241">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev] Question about multithreaded servers</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] Question about multithreaded servers </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, 30 Jan 2000 11:22:11 -0800</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>
On Fri, 14 Jan 2000 11:11:56 -0600 (CST) 
Fabian Lemke &lt;lemkef#execpc,com&gt; wrote:

&gt; Also one thread for client for rendering what they see based on
&gt; game events, and handling input and output to the sockets.  

Most current OSes do not handle large numbers of threads well,
meaning that if you player base grows, you'll start running into
scaling problems with your OS as your thread count rises
proportionally and your OS starts gagging.

&gt; The problem is that the Area threads will be responsible for
&gt; telling the objects to process scripts, and I'll be needing
&gt; commands to get access to objects that may be in other area
&gt; threads - usually not a problem if locking is all proper - but I'm
&gt; worried about deadlocks because I want objects locked during the
&gt; whole script so nothing can be changed on me.  Since object
&gt; scripts can get out-of-area objects to play with, they have to be
&gt; locked for the rest of the script.  If two objects (not in the
&gt; same area) lock themselves to run a script, and then each's script
&gt; attempts to secure the other.....

Is it possible to list the objects, and thus their parent areas that 
a script will need to access prior to the script's execution?

If so, your answer is fairly easy:  Establish a numerical order for
your areas and their component objects.  Lock your objects and areas 
in strict numerical order.  If a lock fails because it is already
held, just wait.  The other script will finish at some point and the 
blocking script can then continue safely.  

The reason for doing things in order is that it prevents there ever
being a deadlock condition where A holds X and is waiting for Y, and
B holds Y and is waiting for X as the ordering process mandates that
both start by locking X and only then progressing to Y.

&gt; Any ideas how this can be solved?  I'm somewhat new to
&gt; multi-threading, but am pretty sure I have a solid grasp on it
&gt; all, but I've little design experience in it.

Essentially you're talking about locking strategies, which hit for
multi-threading, multi-process, cluster, and parallel programming
cases.  I don't know of a decent web site which discusses or coveres
the area well (if you do, please add them to the Library at
Kanga.Nu), but there are various techniques, from the lockless
rollback system i use, to ordered lock handling, to various
applications of graph theory for deadlock detection.  A good OS
desing book should cover -- I've heard good comments on tanenbaum's
books in particular.

-- 
J C Lawrence                                 Home: claw#kanga,nu
----------(*)                              Other: coder#kanga,nu
--=| A man is as sane as he is dangerous to his environment |=--


_______________________________________________
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="00253" HREF="msg00253.html">datagram protocol design theory? (Re: [MUD-Dev] Question about multithreaded servers)</A></strong>
<ul compact><li><em>From:</em> Ola Fosheim Grøstad &lt;olag#ifi,uio.no&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00085" HREF="msg00085.html">[MUD-Dev] Question about multithreaded servers</A></STRONG>
<UL><LI><EM>From:</EM> Fabian Lemke &lt;lemkef#execpc,com&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00240.html">Re: [MUD-Dev] RE: [adv-mud] What good is a hero when nobody knows?</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00242.html">Re: [MUD-Dev] Databases (was Re: Commercial-use Restrictions on Code Bases)</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00087.html">Re: [MUD-Dev] Question about multithreaded servers</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00253.html">datagram protocol design theory? (Re: [MUD-Dev] Question about multithreaded servers)</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00241"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00241"><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] Community Relations</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<LI><strong><A NAME="00267" HREF="msg00267.html">RE: [MUD-Dev] Community Relations</A></strong>, 
Matthew Mihaly <a href="mailto:diablo#best,com">diablo#best,com</a>, Thu 03 Feb 2000, 20:58 GMT
</LI>
</ul>
<LI><strong><A NAME="00280" HREF="msg00280.html">Re: [MUD-Dev] Community Relations</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Tue 08 Feb 2000, 19:07 GMT
</LI>
</ul>
</LI>
<LI><strong><A NAME="00085" HREF="msg00085.html">[MUD-Dev] Question about multithreaded servers</A></strong>, 
Fabian Lemke <a href="mailto:lemkef#execpc,com">lemkef#execpc,com</a>, Fri 14 Jan 2000, 18:38 GMT
<UL>
<LI><strong><A NAME="00087" HREF="msg00087.html">Re: [MUD-Dev] Question about multithreaded servers</A></strong>, 
AR Schleicher <a href="mailto:ars#iag,net">ars#iag,net</a>, Fri 14 Jan 2000, 21:48 GMT
</LI>
<LI><strong><A NAME="00241" HREF="msg00241.html">Re: [MUD-Dev] Question about multithreaded servers</A></strong>, 
J C Lawrence <a href="mailto:claw#kanga,nu">claw#kanga,nu</a>, Sun 30 Jan 2000, 19:22 GMT
<UL>
<LI><strong><A NAME="00253" HREF="msg00253.html">datagram protocol design theory? (Re: [MUD-Dev] Question about multithreaded servers)</A></strong>, 
Ola Fosheim Grøstad <a href="mailto:olag#ifi,uio.no">olag#ifi,uio.no</a>, Mon 31 Jan 2000, 23:35 GMT
</LI>
</UL>
</LI>
</UL>
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00088" HREF="msg00088.html">Re: [MUD-Dev] Question about multithreaded servers</A></strong>, 
Nick Shaffner <a href="mailto:nicks#3drealms,com">nicks#3drealms,com</a>, Sat 15 Jan 2000, 00:30 GMT
<UL>
<LI><strong><A NAME="00094" HREF="msg00094.html">Re: [MUD-Dev] Question about multithreaded servers</A></strong>, 
Ola Fosheim Grøstad <a href="mailto:olag#ifi,uio.no">olag#ifi,uio.no</a>, Sun 16 Jan 2000, 01:56 GMT
<UL>
<LI><strong><A NAME="00101" HREF="msg00101.html">RE: [MUD-Dev] Question about multithreaded servers</A></strong>, 
Fabian <a href="mailto:lemkef#execpc,com">lemkef#execpc,com</a>, Sun 16 Jan 2000, 19:12 GMT
</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>

Site Stats

Snippets: 1791
Codebases: 571