1998Q3/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Fw: lurker emerges -->
<!--X-From-R13: "Xnzrf Ivyfba" <wjvyfbaNebpurfgre.ee.pbz> -->
<!--X-Date: Sun, 9 Aug 1998 08:26:09 &#45;0700 -->
<!--X-Message-Id: 005201bdc3a8$8420b520$961e5d18#default,rochester.rr.com -->
<!--X-Content-Type: text/plain -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] Fw: lurker emerges</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:jwilson#rochester,rr.com">
</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="msg00581.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00583.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg01059.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00583.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00582">Author</A>
&nbsp;|&nbsp;<A HREF="#00582">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00582">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] Fw: lurker emerges</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: &lt;<A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A>&gt;</LI>
<LI><em>Subject</em>: [MUD-Dev] Fw: lurker emerges</LI>
<LI><em>From</em>: "James Wilson" &lt;<A HREF="mailto:jwilson#rochester,rr.com">jwilson#rochester,rr.com</A>&gt;</LI>
<LI><em>Date</em>: Sun, 9 Aug 1998 11:15:14 -0400</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>

-----Original Message-----
From: James Wilson &lt;jwilson#rochester,rr.com&gt;
To: mud-dev#kanga,nu &lt;mud-dev#kanga,nu&gt;
Date: Sunday, August 09, 1998 2:06 AM
Subject: lurker emerges


[snip]


&gt;As I see it, not having gone the whole nine and tested it out, using a
&gt;single, select()ing thread to do all your stuff would work fine if each
&gt;operation is bounded by some small
&gt;amount of time. That is, if you spend too much time in processing the
&gt;received action,
&gt;your responsiveness to pending requests goes down. I'm not sure how or if
&gt;this issue is solved in the select()-based http servers, and am looking at
&gt;the source code to try to suss it out. How do they deal with a request for
a
&gt;bigass file? Do all the ripe sockets wait to be select()ed while the bigass
&gt;file is sent on its merry way? News at 11.


update: thttpd uses select() for multiplexing its output as well as its
input. Thus the bigass file's transmission is interleaved with all other
sent files.

&gt;The simplest way of serializing mud processes would be to lock the database
&gt;and heap of in-memory mud objects for every transaction. It seems to me
this
&gt;would reduce the system to one essentially identical to the single-threaded
&gt;select() server. The lockless system described in the FAQ could be an
&gt;improvement on this. In this system, access to the database is atomic,
while
&gt;in-memory objects are thread-local and competing modifications get resolved
&gt;with a repeat of the modifying event. This pushes the serialization to
&gt;different places, namely the point at which the database is read to
generate
&gt;the local copies and the point at which the database is written and checked
&gt;for discrepancies. This is still an improvement because the lockless system
&gt;allows concurrent processing once objects have been read in from the
&gt;database. (I am still a little fuzzy on some details - how is the
collection
&gt;of objects to 'clone' determined?  Does the cloning thread save two clones
&gt;of the object, one 'as it was read in', and one 'production copy'? If not,
&gt;how does it know the difference between the object's state-at-snapshot and
&gt;the object's current database state (which might reflect modifications by
&gt;other threads)? If a thread grabs an object and runs for a long time, will
&gt;it see modifications to that object, or work with the old copy?)


I retract these questions after rereading the FAQ. Instead, let me ask:

1. if one obtains an object which contains a reference to another, and
then obtains the referent, does this require two DB hits? If so, perhaps a
prefetching strategy could be used: requesting object foo gets you foo
together with everything it points to (but nothing beyond that). This could
be a loss if the larger set incurs extra collisions with other threads to
the
extent that any gains from prefetching are swamped.

2. how can one use this system to guarantee correctness when dealing with
compound
objects? For example, suppose that A points to B and B points to A, and
further you would like to ensure that if at any time A no longer points to
B, it will
also be true that B no longer points to A, and vice versa. Imagine a
parent-child
relationship, where 'A child-of B' iff 'B parent-of A'. Now suppose thread
T1 obtains a reference to A with the understanding that this invariant
holds. Simultaneously, T2 obtains B and changes it so it no longer points to
A. If T2 commits B to the
database before committing A, the invariant is broken - T1 has a copy of A
which points to B, which does not point to A. This would be a race condition
(or a "dragon's
door", as it has been termed here). If on the other hand T2 grabs A as well,
breaks the link to B, and commits A before B, again the database will
violate
the invariant; while T1 in this example would be safe because its cache
would be
invalidated, a third thread T3 holding a clone of B would be endangered in
the
mirror version of T1 with A in the first case. Finally, there could be a
provision for
multiple simultaneous commits, which would correctly invalidate the caches
of T1 and
T3 and ensure the large-scale correctness of the data structure. If the
large-scale
structure is large, however, it would be quite possible that an event which
needed
to access every component and commit them all en masse could be constantly
aborted by commits to the components from other threads. That is, suppose
that in the
case above, T2 reads in A and B and modifies them before attempting a
simultaneous
commit. Meanwhile T1 and T3 are regularly modifying A and B, such that T2 is
always interrupted before it can finish its works with both and commit them.
Granted,
this is highly unlikely if you are talking about only two objects, but
suppose you
were dealing with a large data structure whose components are regularly
being
modified by other threads? How could you be sure you would eventually get to
commit your changes?

James





</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="01052" HREF="msg01052.html">[MUD-Dev] Re: Lockless DB design  (was Fw: lurker emerges)</A></strong>
<ul compact><li><em>From:</em> J C Lawrence &lt;claw#under,engr.sgi.com&gt;</li></ul>
<li><strong><A NAME="00583" HREF="msg00583.html">[MUD-Dev] Re: Fw: lurker emerges</A></strong>
<ul compact><li><em>From:</em> "T. Alexander Popiel" &lt;popiel#snugharbor,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="msg00581.html">[MUD-Dev] Re: ADMIN: Advertising on MUD-Dev</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00583.html">[MUD-Dev] Re: Fw: lurker emerges</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg01059.html">[MUD-Dev] Re: lurker emerges</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00583.html">[MUD-Dev] Re: Fw: lurker emerges</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00582"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00582"><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: lurker emerges</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<LI><strong><A NAME="00614" HREF="msg00614.html">[MUD-Dev] Re: lurker emerges</A></strong>, 
Vadim Tkachenko <a href="mailto:vt#freehold,crocodile.org">vt#freehold,crocodile.org</a>, Mon 10 Aug 1998, 05:57 GMT
</LI>
<LI><strong><A NAME="01055" HREF="msg01055.html">[MUD-Dev] Re: lurker emerges</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Thu 17 Sep 1998, 00:57 GMT
</LI>
</ul>
<LI><strong><A NAME="01058" HREF="msg01058.html">[MUD-Dev] Re: lurker emerges</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Thu 17 Sep 1998, 02:19 GMT
<UL>
<LI><strong><A NAME="01059" HREF="msg01059.html">[MUD-Dev] Re: lurker emerges</A></strong>, 
J C Lawrence <a href="mailto:claw#kanga,nu">claw#kanga,nu</a>, Thu 17 Sep 1998, 06:32 GMT
</LI>
</UL>
</LI>
</ul>
</LI>
<LI><strong><A NAME="00582" HREF="msg00582.html">[MUD-Dev] Fw: lurker emerges</A></strong>, 
James Wilson <a href="mailto:jwilson#rochester,rr.com">jwilson#rochester,rr.com</a>, Sun 09 Aug 1998, 15:26 GMT
<UL>
<LI><strong><A NAME="00583" HREF="msg00583.html">[MUD-Dev] Re: Fw: lurker emerges</A></strong>, 
T. Alexander Popiel <a href="mailto:popiel#snugharbor,com">popiel#snugharbor,com</a>, Sun 09 Aug 1998, 15:57 GMT
</LI>
<LI><strong><A NAME="01052" HREF="msg01052.html">[MUD-Dev] Re: Lockless DB design  (was Fw: lurker emerges)</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Thu 17 Sep 1998, 00:11 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00578" HREF="msg00578.html">[MUD-Dev] Re: Adverts in email on the list.</A></strong>, 
quzah <a href="mailto:quzah#geocities,com">quzah#geocities,com</a>, Sun 09 Aug 1998, 08:39 GMT
<UL>
<LI><strong><A NAME="00594" HREF="msg00594.html">[MUD-Dev] Re: Adverts in email on the list.</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Sun 09 Aug 1998, 19:47 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>