<!-- MHonArc v2.4.4 --> <!--X-Subject: [MUD-Dev] Re: Sockets and fibers --> <!--X-From-R13: "Oqnz X. Fubeagba" <nqnzNcubravk.Bevaprgba.SRG> --> <!--X-Date: Wed, 20 Jan 1999 18:27:54 -0800 --> <!--X-Message-Id: 19990120212643.A29130#tucson,Princeton.EDU --> <!--X-Content-Type: text/plain --> <!--X-Reference: 009301be44a3$ee058610$55e5edd0@dev-18.chilisoft.com --> <!--X-Head-End--> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>MUD-Dev message, [MUD-Dev] Re: Sockets and fibers</title> <!-- meta name="robots" content="noindex,nofollow" --> <link rev="made" href="mailto:adam#phoenix,Princeton.EDU"> </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> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] <br clear=all><hr> <!--X-Body-Begin--> <!--X-User-Header--> <!--X-User-Header-End--> <!--X-TopPNI--> Date: [ <a href="msg00235.html">Previous</a> | <a href="msg00236.html">Next</a> ] Thread: [ <a href="msg00228.html">Previous</a> | <a href="msg00241.html">Next</a> ] Index: [ <A HREF="author.html#00239">Author</A> | <A HREF="#00239">Date</A> | <A HREF="thread.html#00239">Thread</A> ] <!--X-TopPNI-End--> <!--X-MsgBody--> <!--X-Subject-Header-Begin--> <H1>[MUD-Dev] Re: Sockets and fibers</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: Sockets and fibers</LI> <LI><em>From</em>: "Adam J. Thornton" <<A HREF="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</A>></LI> <LI><em>Date</em>: Wed, 20 Jan 1999 21:26:43 -0500</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> Whoops. Sent this earlier from the wrong account. On Wed, Jan 20, 1999 at 10:36:44AM -0800, Caliban Tiresias Darklock wrote: [Adam:] > >How would this differ from a poll-and-select() model under a Real OS? > > > By poll-and-select I assume you mean the standard "port concentrator" type > thing where you have a big array of sockets and just iterate through it > looking for recv() data and sending data where necessary. This was sort of > my final question; is that really a bad thing? There are a couple of web server designs that do it that way; if you don't mind doing the bookkeeping yourself, it gives quite good performance on modern hardware. > As far as a Real OS goes, I'm designing under Windows primarily because it's > going to be easier to port *from* Windows later. (Lacking a user interface, > this is a lot easier than your average Windows-to-other port.) I'm intending > to separate all the O/S dependencies into two files; one to handle > connections and send/recv (I always have to correct "xmit" to "send" when I > talk about that) and one to handle access to files and resources on the > server. Everything else will be straight C using the standard library, and > will not interact with the user or the network in the slightest other than > through a simple command/response API. Well, OK, but why do Windowsisms at all? If Windows has a POSIX.1 layer (surely it must, musn't it? I admit I haven't looked, but I'd assume it would) then you can do all this with Posixy calls, and save yourself almost all the OS-dependent bits. > >I suppose this really turns into a request about what a fiber is. > > Per MS docs: "A fiber is a lightweight thread that is manually scheduled. > Specific fiber APIs include: ConvertThreadToFiber() CreateFiber() > DeleteFiber() GetCurrentFiber() GetFiberData() SwitchToFiber()" > > Yeah, I don't get it either. Furthermore, MS adds: > > "Fibers are designed to be employed by a single-threaded application, in > which case the leak will never occur. However, if threads with fibers are > started and terminated repeatedly, this can cause accumulation of memory > leaks and will eventually cause the process to run out of memory." Er, yuck. Assuming that Windows implements something like a nonblocking select(), I'd think that'd be the way to go instead. Adam -- adam#princeton,edu "There's a border to somewhere waiting, and a tank full of time." - J. Steinman </PRE> <!--X-Body-of-Message-End--> <!--X-MsgBody-End--> <!--X-Follow-Ups--> <HR> <!--X-Follow-Ups-End--> <!--X-References--> <UL><LI><STRONG>References</STRONG>: <UL> <LI><STRONG><A NAME="00228" HREF="msg00228.html">[MUD-Dev] Re: Sockets and fibers</A></STRONG> <UL><LI><EM>From:</EM> "Caliban Tiresias Darklock" <caliban#darklock,com></LI></UL></LI> </UL></LI></UL> <!--X-References-End--> <!--X-BotPNI--> <UL> <LI>Prev by Date: <STRONG><A HREF="msg00235.html">[MUD-Dev] Re: META: list "peerage"</A></STRONG> </LI> <LI>Next by Date: <STRONG><A HREF="msg00236.html">[MUD-Dev] Re: Graphic design doc</A></STRONG> </LI> <LI>Prev by thread: <STRONG><A HREF="msg00228.html">[MUD-Dev] Re: Sockets and fibers</A></STRONG> </LI> <LI>Next by thread: <STRONG><A HREF="msg00241.html">[MUD-Dev] Re: Sockets and fibers</A></STRONG> </LI> <LI>Index(es): <UL> <LI><A HREF="index.html#00239"><STRONG>Date</STRONG></A></LI> <LI><A HREF="thread.html#00239"><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: META: list "peerage"</STRONG>, <EM>(continued)</EM> <ul compact> <LI><strong><A NAME="00453" HREF="msg00453.html">[MUD-Dev] Re: META: list "peerage"</A></strong>, Sayeed <a href="mailto:yu219121#YorkU,CA">yu219121#YorkU,CA</a>, Thu 18 Feb 1999, 18:07 GMT </LI> </ul> </LI> <LI><strong><A NAME="00222" HREF="msg00222.html">[MUD-Dev] Re: ADMIN: List server and Kanga.Nu host changes</A></strong>, Koster, Raph <a href="mailto:rkoster#origin,ea.com">rkoster#origin,ea.com</a>, Thu 21 Jan 1999, 00:04 GMT <LI><strong><A NAME="00221" HREF="msg00221.html">[MUD-Dev] Re: [DevMUD] Re: From Devmud: Database module, draft 3</A></strong>, Greg Connor <a href="mailto:gconnor#nekodojo,org">gconnor#nekodojo,org</a>, Wed 20 Jan 1999, 23:58 GMT <LI><strong><A NAME="00228" HREF="msg00228.html">[MUD-Dev] Re: Sockets and fibers</A></strong>, Caliban Tiresias Darklock <a href="mailto:caliban#darklock,com">caliban#darklock,com</a>, Wed 20 Jan 1999, 18:41 GMT <UL> <LI><strong><A NAME="00239" HREF="msg00239.html">[MUD-Dev] Re: Sockets and fibers</A></strong>, Adam J. Thornton <a href="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</a>, Thu 21 Jan 1999, 02:27 GMT </LI> <LI><strong><A NAME="00241" HREF="msg00241.html">[MUD-Dev] Re: Sockets and fibers</A></strong>, J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Thu 21 Jan 1999, 04:01 GMT <UL> <LI><strong><A NAME="00243" HREF="msg00243.html">[MUD-Dev] Re: Sockets and fibers</A></strong>, Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Mon 25 Jan 1999, 02:00 GMT </LI> </UL> </LI> </UL> <UL> <li><Possible follow-up(s)><br> <LI><strong><A NAME="00295" HREF="msg00295.html">[MUD-Dev] Re: Sockets and fibers</A></strong>, Dr. Cat <a href="mailto:cat#oldzoom,bga.com">cat#oldzoom,bga.com</a>, Tue 26 Jan 1999, 21:56 GMT </LI> </UL> </LI> <LI><strong><A NAME="00225" HREF="msg00225.html">[MUD-Dev] Sockets and fibers</A></strong>, Caliban Tiresias Darklock <a href="mailto:caliban#darklock,com">caliban#darklock,com</a>, Wed 20 Jan 1999, 17:15 GMT </LI> </UL></BLOCKQUOTE> </ul> <hr> <center> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] </center> <hr> </body> </html>