Subject: Re: the evil of continuations
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 2 Sep 2000 04:21:18 GMT
Newsgroups: comp.lang.scheme,comp.lang.lisp
Message-ID: <8opv7u$n9d1u$1@fido.engr.sgi.com>
Matthew R Wette  <Matthew.R.Wette@jpl.nasa.gov> wrote:
+---------------
| Solaris uses a user-level + kernel-level thread approach.  The kernel
| threads are mapped to processors.  The user threads are mapped to
| kernel threads.  There are hooks to allow the user to specify how many
| processors should be used.  There used to be white papers on this
| design but I just looked on sun.com and didn't find them.
+---------------

SGI does something similar. From <URL:http://techpubs.sgi.com/library/
dynaweb_bin/ebt-bin/0650/nph-infosrch.cgi/infosrchtpl/SGI_Developer/
OrOn2_PfTune/@ebt-link;he=0?target=%25N%15_10657_START_RESTART_N%25;
DwebQuery=threads>, we see that we *used* to do "m-on-n" scheduling
(as above), but now[*] do the multi-CPU dispatching entirely in user mode:

	C Source Using POSIX Threads
	...
	You can write a multithreaded program using the POSIX threads model
	and POSIX synchronization primitives (POSIX standards 1003.1b,
	threads, and 1003.1c, realtime facilities). The use of these
	libraries is documented in Topics in IRIX Programming, listed
	in the section "Software Tool Manuals". 

	Through IRIX 6.4, the implementation of POSIX threads creates a
	certain number of IRIX processes and uses them to execute the
	pthreads. Typically the library creates fewer processes than the
	program creates pthreads (called an "m-on-n" implementation).
	You cannot control or predict which process will execute the code
	of any pthread at any time. When a pthread blocks, the process
	running it looks for another pthread to run.

[*]==>	Starting with IRIX 6.5, the pthreads library allocates a varying
	number of execution resources (basically, CPUs) and dispatches them
	to the runnable threads. These execution resources are allocated
	and dispatched entirely in the user process space, and do not
	require the creation of UNIX processes. As a result, pthread
	dispatching is more efficient.

The "Topics in IRIX Programming" document mentioned can be found at
<URL:http://techpubs.sgi.com/library/dynaweb_bin/ebt-bin/0650/
nph-infosrch.cgi/infosrchtpl/SGI_Developer/T_IRIX_Prog/
@InfoSearch__BookTextView/4>.

Look particularly at "Part Four: Models of Parallel Computation",
"Chapter 13, "Thread-Level Parallelism". Table 13-1 in that section
provides a fairly extensive comparison of POSIX threads, "Lightweight
Processes" [such as Irix's "sproc()"], and traditional Unix processes.


-Rob

-----
Rob Warnock, 41L-955		rpw3@sgi.com
Applied Networking		http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		PP-ASEL-IA
Mountain View, CA  94043