[241] in java-interest
Re: Threads vs New White Paper
daemon@ATHENA.MIT.EDU (Jim.Graham@Eng.Sun.COM)
Thu Jun 8 16:23:04 1995
Date: Thu, 8 Jun 1995 12:42:01 -0700
To: java-interest@java.Eng.Sun.COM, pdoane@pcnet.com
From: Jim.Graham@Eng.Sun.COM
Hi Patrick,
> >The underlying implementation is guaranteed to be preemtive. On platforms
> >that do not support thread preemtion (like the Mac), we'll make sure that
> >the thread is rescheduled on the next opportunity. In our Mac port we
> >check for this on every branch and method call. This "poor-mans" preemtion
> >provides you with similar semantics as true preemption.
>
> I'm interested as to why the "poor-mans" approach was taken here to
> provide the pre-emptive model. Why not write a custom thread manager for
> the Macintosh Java implementation. I'm fairly sure that the OS support that
> exists is just using the Time Manager or some variant thereof. It seems to
> me that placing a yield() into every branch or method call would could
> cause the program to slow down considerably.
What Arthur is describing above is that the interpreter checks a flag
to see if a higher priority thread needs to run and then does a yield()
if necessary. This is not the same as executing the yield() on every
branch. All that gets done in the typical case is a memory fetch and
test.
...jim
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com