[MUD-Dev] Re: [Java] multithreading: update and a question

Nathan F Yospe yospe at hawaii.edu
Wed Jul 15 15:51:37 CEST 1998


On Tue, 14 Jul 1998, Vadim Tkachenko wrote:

Surprised JCL hasn't snapped this yet...

:Hello,

:Just read the article about Java/Solaris implementation of
:multithreading and have some questions.

:Okay, they say, there are 3 MT models:

:one-to-one: one user thread corresponds to one kernel thread, this
<snip>
:many-to-one: all the user thread map to one kernel thread (process),
<snip>
:many-to-many: there are N user threads and M kernel threads, and the
<snip>
:around, and the article claims that Solaris is the only OS which
:supports this kind of thing (they say Windows, OS/2 and AIX have
:one-to-one model).

>From the SGI developer's pages (requires a password):

The POSIX specification evolved over several years and 10 drafts. Early
drafts exist as real implementations - DCE contains an implementation of
Draft 4 for example. Although POSIX is a standard it still contains options
and an application has -- to take appropriate steps to ensure real
portability on compliant systems.

The pthreads interfaces deliberately permit several implementation
strategies:

       Many-to-one - uses a single kernel execution vehicle to execute the
pthreads by multiplexing between them and being very careful to avoid
blocking in the kernel and starving runnable pthreads. The default DCE
package uses this model. 
       This scheme doesn't scale to multiprocessors. Switching between
pthreads is always in user space and therefore relatively cheap. Some
implementation synchronisation details are simpler and the implementation can
be portable. There is a cost in complexity when dealing with blocking system
calls. 

       One-to-one - uses one kernel execution vehicle per pthread. This
scales to MP systems and makes the implementation fairly simple. Context
switches between pthreads though are done through the kernel and each pthread
is a comparatively costly beast. 

       Many-to-few - uses a pool of kernel execution vehicles to run the
pthreads. This model scales to MP systems and can use user space context
switching. The major cost is implementation complexity. [This is the SGI
pthreads model.]

- Looks like SGI's got the same thing, based on this.

--

Nathan F. Yospe - Aimed High, Crashed Hard, In the Hanger, Back Flying Soon
Jr Software Engineer, Textron Systems Division (On loan to Rocketdyne Tech)
(Temporarily on Hold) Student, University of Hawaii at Manoa, Physics Dept.
yospe#hawaii.edu nyospe#premier.mhpcc.af.mil http://www2.hawaii.edu/~yospe/






More information about the mud-dev-archive mailing list