msg00728.html

1998Q3/msg00728.html · 7.6 KB

From the archive 1998Q3.zip

Download the archive   « Back to the archive contents

<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Re: Yet another update on threads and signals -->
<!--X-From-R13: Quevf Uenl <ptNnzv&#45;pt.UenlEntr.Sqzbagba.OP.QO> -->
<!--X-Date: Fri, 14 Aug 1998 18:12:06 &#45;0700 -->
<!--X-Message-Id: 199808150112.TAA05183@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, [MUD-Dev] Re: Yet another update on threads and signals</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="msg00727.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00729.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00792.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00733.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00728">Author</A>
&nbsp;|&nbsp;<A HREF="#00728">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00728">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] Re: Yet another update on threads and signals</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: Yet another update on threads and signals</LI>
<LI><em>From</em>: Chris Gray &lt;<A HREF="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</A>&gt;</LI>
<LI><em>Date</em>: Fri, 14 Aug 1998 19:12:09 -0600</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>
[Adam J. Thornton:]

 &gt;OK, so trapping the signal in a signal handler won't work, because the
 &gt;POSIX thread functions are not reentrant.
 &gt;
 &gt;However, using sigwait() will, so instead of a signal handler, I'll spawn a
 &gt;thread whose only purpose in like is to wait for that signal and, upon
 &gt;receiving it, do its magic.  It can just block in sigwait() until the
 &gt;signal is delivered.

I was going to reply to this thread yesterday, but was checking to see
if anyone else had good ideas, and then forgot...

It would add a bit of extra latency, but consider having an extra
process to act as an fd distributor. Each room-process would have an
open socket to that process (the distributor avoids each room having
to have a socket to every other room). Then, to send a player from
one room to another:

Departing room:
    write a message, with room indicator and fd, to the distributor

Distributor:
    sitting on select on the set of room sockets.
    wakes up, reads message and gets fd.
    writes message on socket to target room

Target room:
    sitting on select of player sockets and distributor socket
    wakes up, sees activity on distributor socket
    reads message and gets fd - player is moved.

Presumably you could send whatever other data you wanted along with
the fd, perhaps minimizing the amount of shared memory or file I/O
that is needed to move the player. Normally, using the sockets is
more expensive than, say, shared memory, but since you would already
be using it, there is little extra cost in sending more data.

-- 
Chris Gray     cg#ami-cg,GraySage.Edmonton.AB.CA


</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="00733" HREF="msg00733.html">[MUD-Dev] Re: Yet another update on threads and signals</A></strong>
<ul compact><li><em>From:</em> "Adam J. Thornton" &lt;adam#phoenix,Princeton.EDU&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="msg00727.html">[MUD-Dev] Re: clients anyone?...</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00729.html">[MUD-Dev] RE: [Mud-Dev] Re: Affordances and  social method</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00792.html">[MUD-Dev] Re: UBE/high: RE: [Mud-Dev] Re: Affordances and  social method</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00733.html">[MUD-Dev] Re: Yet another update on threads and signals</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00728"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00728"><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] Marian's Tailor Problem</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<LI><strong><A NAME="00753" HREF="msg00753.html">[MUD-Dev] Marian's Tailor Problem</A></strong>, 
Brandon Cline <a href="mailto:brandon#sedona,net">brandon#sedona,net</a>, Tue 18 Aug 1998, 00:47 GMT
<UL>
<LI><strong><A NAME="00767" HREF="msg00767.html">[MUD-Dev] Re: Marian's Tailor Problem</A></strong>, 
Ola Fosheim Grøstad <a href="mailto:olag#ifi,uio.no">olag#ifi,uio.no</a>, Tue 18 Aug 1998, 16:15 GMT
</LI>
</UL>
</LI>
</ul>
</ul>
</LI>
<LI><strong><A NAME="00729" HREF="msg00729.html">[MUD-Dev] RE: [Mud-Dev] Re: Affordances and  social method</A></strong>, 
Koster, Raph <a href="mailto:rkoster#origin,ea.com">rkoster#origin,ea.com</a>, Sat 15 Aug 1998, 02:33 GMT
<UL>
<LI><strong><A NAME="00792" HREF="msg00792.html">[MUD-Dev] Re: UBE/high: RE: [Mud-Dev] Re: Affordances and  social method</A></strong>, 
Dr. Cat <a href="mailto:cat#bga,com">cat#bga,com</a>, Fri 21 Aug 1998, 03:56 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00728" HREF="msg00728.html">[MUD-Dev] Re: Yet another update on threads and signals</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sat 15 Aug 1998, 01:12 GMT
<UL>
<LI><strong><A NAME="00733" HREF="msg00733.html">[MUD-Dev] Re: Yet another update on threads and signals</A></strong>, 
Adam J. Thornton <a href="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</a>, Sat 15 Aug 1998, 05:20 GMT
</LI>
</UL>
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00736" HREF="msg00736.html">[MUD-Dev] Re: Yet another update on threads and signals</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sat 15 Aug 1998, 15:31 GMT
<UL>
<LI><strong><A NAME="00741" HREF="msg00741.html">[MUD-Dev] Re: Yet another update on threads and signals</A></strong>, 
Adam J. Thornton <a href="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</a>, Sat 15 Aug 1998, 19:22 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00742" HREF="msg00742.html">[MUD-Dev] Re: Yet another update on threads and signals</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sat 15 Aug 1998, 20:54 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>

Site Stats

Snippets: 1791
Codebases: 571