[1673] in java-interest

home help back first fref pref prev next nref lref last post

Re: Threads don't make sense

daemon@ATHENA.MIT.EDU (Chris Warth)
Wed Sep 13 19:26:37 1995

Date: Wed, 13 Sep 1995 12:42:13 -0700
From: csw@scndprsn.Eng.Sun.COM (Chris Warth)
To: java-interest@java.Eng.Sun.COM, mpasqui@UOFT02.UTOLEDO.EDU

  > 
  > I'm kind of confused on the 'yield' issue. As I understand it
  > (which could be my first problem) threads of the same priority will
  > only yield the CPU to threads of higher priority.

This is an over-simplification.  Threads will only yield to higher
priority processes as long as they remain "runnable".  There are lots
of conditions under which the thread is no longer runnable.  For
instance, a thread become "blocked" (not runnable) whenever any of the
following occur:

1. when waiting to enter a monitor that is owned by another thread,

2. when waiting on a condition variable, 

3. when doing a system call like read
   or open that might block (those are wrapped in monitors on solaris now
   so it is a just a special case of #1 or #2)

-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post