Subject: Re: scheme-based mud client
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 1998/12/08
Newsgroups: comp.lang.scheme
Message-ID: <74io2l$16v82@fido.engr.sgi.com>
Craig Johnston <caj@lfn.org> wrote:
+---------------
| Currently, what I am looking at is basically just doing a select loop
| in c and calling scheme procedures with output from the mud socket(s).  
| ... One big question is what scheme implementation to use.  Since
| the whole thing is basically going to be driven by a select loop,
| I want to call scheme as a library from c...
+---------------

You can do that. On the other hand, MzScheme has built-in "threads"
and internally provides a "select()"-based scheduler, so that if you
want to make life easy for yourself you could just spawn a MzScheme
thread for each MUD socket, whereupon the completion of a "blocking"[*]
read would automatically wake up the appropriate thread.

Just a thought...


-Rob

[*] From the point of view of the thread, not the whole MzScheme process.
MzScheme takes "blocking" Scheme reads ["(read-char)", "(read)", etc.] and
turns them into non-blocking Unix reads, and then sleeps on a select() when
no thread is runnable. See:

    Threads:
        http://www.cs.rice.edu/CS/PLT/packages/doc/mzscheme/node92.htm
    Networking:
        http://www.cs.rice.edu/CS/PLT/packages/doc/mzscheme/node136.htm

-----
Rob Warnock, 8L-855		rpw3@sgi.com
Applied Networking		http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673
2011 N. Shoreline Blvd.		FAX: 650-964-0811
Mountain View, CA  94043	PP-ASEL-IA