[708] in java-interest

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

Threads and select ()

daemon@ATHENA.MIT.EDU (Nathan Abramson)
Mon Jul 17 13:55:58 1995

From: Nathan Abramson <arista@art.redstar.com>
Date: Mon, 17 Jul 1995 11:56:28 -0400
To: java-interest@java.Eng.Sun.COM, arista@art.redstar.com


Maybe someone could help me out with a couple of questions I have
regarding Threads...

1) Is the thread multitasking preemptive, or cooperative?  The "synchronized"
   keyword seems to imply preemptive threading, but then the "yield ()"
   function seems to imply that the programmer has to explicitly give
   control to another thread (which I found to be the case).  If the
   latter is true, why?  Shouldn't an interpreter be able to handle
   preemptive multithreading?

2) There is a function to put a thread to sleep for a certain length of
   time.  But is there a way for a thread to sleep while waiting for
   file descriptor activity, ala UNIX select ()?  If not, is there a
   way to make a network server or other event-driven application based
   on file descriptors run without the dreaded load of "1.00" when idle?

Nathan Abramson
Art Technology Group

-
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