Subject: Re: the evil of continuations
From: (Rob Warnock)
Date: 2 Sep 2000 04:21:18 GMT
Newsgroups: comp.lang.scheme,comp.lang.lisp
Message-ID: <8opv7u$n9d1u$>
Matthew R Wette  <> 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 and didn't find them.

SGI does something similar. From <URL:
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

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 Warnock, 41L-955
Applied Networking
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		PP-ASEL-IA
Mountain View, CA  94043