The Artima Developer Community
Sponsored Link

Legacy Design Forum
Designing with Static Members



This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


JVM and println

Posted by Dalibor Topic on January 23, 2002 at 9:15 AM

> when a class makes a println for example, where is the real println code? i know that it belongs to the API but once again, is the println specific machine code inside the API or when the JVM finds a call to println changes it by a call to a device driver that actually prints the string ?
> if the JVM acts like a translactor of API calls to device driver calls, does this mean that device drivers, which are in the bottom of of the JVM, should implement all API classes?

It is usually the API implementation that performs fundamental
I/O operations. When you need to work with a device driver, the
API implementation should call some native code to do the work.
The virtual machine should handle the code like any other
native code.

There are some API methods (process & thread management, for
example) where the API implementation needs to call native
methods to do the work, but also needs access to state
information from the virtual machine. So define an API
to the virtual machine for native code, to be able to get that
to work. The standard virtual machine debugging & profiling
APIs might be sufficient, though.

good luck.


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us