harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Archie Cobbs <arc...@dellroad.org>
Subject Re: [jchevm] Harmony Class Lib does "Hello World" on a GNU Classpath JVM
Date Thu, 09 Mar 2006 17:48:14 GMT
Weldon Washburn wrote:
> I can now run the below multithread Hello.java on JCHEVM using Apache
> Harmony Class Library.  The output toggles between clumps of "Hello
> World" and clumps of "*" as WindowsXP schedules the two application
> threads.  This is behavior I would expect. I use System.out.write()
> because System.out.println() does not work yet.   A summary follows:

Wow! Impressive achievment & very cool.

> Mods to JCHEVM to get it to work
> 1)
> I was not able to find the _JC_LIB_ENTRY that is intended for
> read/writing files.  I gave up and "borrowed"
> JCNI_java_lang_VMThread_nativeSetPriority().  Instead of actually
> changing thread priority, it now does a "fprintf(stdout, "%s",
> &priority); fflush(stdout);"  Perhaps you can tell me what native
> method I should be using.

Classpath supplies its own native methods for file I/O. That is,
you can implement file I/O normally using normal native methods.
This is not something the VM needs to be directly involved with.
So the "fix" would be for classlib to implement this itself.

There's no reason you couldn't write a gnu.classpath.Pointer
class if you wanted to. There's no copyright on the package
name :-)

By the way jchevm's Thread.setPriority() doesn't work because
I don't know how to implement it using POSIX.

> 2)
> I commented out some stuff in bootstrap.c that was dragging in
> specific gnu classpath *.class files like "Lgnu/classpath/Pointer;" 
> We should discuss the best solution for this item.

This is use as part of the NIO implementation for "direct" buffers.
A Pointer object simply contains an int or long that holds a void *.

> One last item.  I don't know which SVN repository to place this work
> in.  Any suggestions?

You could create a branch of classlib in the "sandbox".


Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com

View raw message