Java VM can be implemented on any target platform that supports multi-threading
- and Java runs on any platform on which teh interpreter and run time system
are available.
Does this mean - Java depends on the OS thread support or it has its own
mechanisms? IS tehere a Java interpreter for UNIX yet?
I have a big bunch of C++ code - I would like to import to Java - Now for which
I need to know if UNIX has a Java interpreter - UNIX SVR4 /SCo .
Thanx in advance -
rebecca
Java does not require a platform to supply multithreading support. In fact,
two of the three systems Sun is responsible implement their own threads (on
Solaris and MacOS -- on Win32 we use native threads). Of course, if your
platform doesn't give you threads, you do have to supply your own somehow.
---
Tim Lindholm Voice: +1 415 473 7259 (Internal: x47259)
Sun Microsystems, Inc. Internet: lind...@eng.sun.com
100 Hamilton Ave. Palo Alto, CA 94301-1616 USA
>rebecca asks:
>
>>Does this mean - Java depends on the OS thread support or it has its own
>>mechanisms?
>
>I'm sure the win95 version uses native threads, and from what I've heard
>from others, the Sun implementation does also, but I see no reason a
>non-threaded OS couldn't implement a multi-threaded runtime using an
>internal event loop. Of course this is a rather clumsy solution. Also
>note that the specs require a multithreaded VM, but they explicitly don't
>require a time sliced thread model. That is what the yield() method is
>there for. Of course in the real world nobody seems to be paying much
>attention to yield, so for all practical purposes all implementations had
>better time slice to be usefull.
One possible headache with such implementations is the underlying toolbox
that most likely would not be written to be re-entrant. If there was code
calling the toolbox, you need to control those parts very carefully, and
the thread could not sleep or block, instead wait until the toolbox
operation has completed. That would then again cause a lot of headaches
with the overall thread performance and thread priority control.
--Kent
Kent Sandvik, Silicon Graphics, Inc.
Email: san...@sgi.com Phone: +1 415 933-6417
http://reality.sgi.com/employees/sandvik_engr/ (sgi http:/kent.engr)
"May all developers be happy."
>Does this mean - Java depends on the OS thread support or it has its own
>mechanisms?
I'm sure the win95 version uses native threads, and from what I've heard
from others, the Sun implementation does also, but I see no reason a
non-threaded OS couldn't implement a multi-threaded runtime using an
internal event loop. Of course this is a rather clumsy solution. Also
note that the specs require a multithreaded VM, but they explicitly don't
require a time sliced thread model. That is what the yield() method is
there for. Of course in the real world nobody seems to be paying much
attention to yield, so for all practical purposes all implementations had
better time slice to be usefull.
--Jeffrey L. Straszheim