> Im new to Solaris so I cant really say how > things would work. > But would there be a way for (Open)Solaris have > a module in the kernel to run Java in a > native/faster/better way ?
There's already a kernel java exec module that allows one to use system calls like execve(2) on suitably built jar files; see http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/exec/java/java.c That doesn't do anything to make it much if any faster, it's more a convenience (analogous to #! interpreter execs, except that the interpreter (interface to the JVM) is hardcoded), than anything else. To my way of thinking, anything else is outside the scope of the kernel, at least unless a Java byte code hardware coprocessor becomes something likely to be and remain for a reasonable interval both a practical and a marketable advantage, to the point of making kernel support for it worthwhile. However, what the kernel java exec module uses as /usr/java/jre/lib/{sparc,i386}/jexec could hypothetically be smarter; for example, if the JVM (or a wrapper) could create/check for currentness/correct platform of parallel precompiled-to-native shared objects (which it would then load and call into in place of byte code). I don't know enough to know if that is generally possible (or often enough to be useful, with some sort of marker file to be created if it wasn't possible in a specific case, so that the test to determine that wouldn't have to be repeated unnecessarily). Such an arrangement would probably be a little _slower_ on first execution, but faster later on. There would be permission issues: ideally it would only consider creating the cache file if being run by the userid owning the jar file (and with the ability to set the same group id on the cache file), and if the directory was writable+searchable by that userid. Plenty of other non-kernel speedups may also be possible (and plenty have already happened, I think). > Would be better to build software with Java on > the top of the existing Solaris ? I think that if > this could be done somehow would improve the presence > of Java on the desktops. > Just wondering. I'm not sure what you mean. Solaris is probably as good a host platform for Java apps as anything, and perhaps better than most, given that Sun originated both. Some Solaris apps use Java now; some are ok, some are widely disliked for having been implemented in Java, and in some cases, that may be due not to the use of Java, but to the specifics of the implementation (other sorts of design and coding issues). I think if Java applications were introduced only where they were at least as good in both performance and functionality as what came before, or for something new, were approximately as good in both as a native implementation, then Java applications would have a better reputation. It's frequently _possible_ to write good apps in Java, indeed it's not necessarily all that hard. However, it's also possible to write horrible apps in Java (or in C++ for that matter; object-oriented approaches take more skill and effort in design and planning, with all the possible ways of solving a problem that they offer, and for some purposes, the promise of reuse or extensibility may not be worth the extra effort). So I think that _good_ examples might help, esp. if they were open-source, and some particularly suitable ones were dissected in an accompanying tutorial on writing Java code to a higher standard. This message posted from opensolaris.org _______________________________________________ opensolaris-discuss mailing list [email protected]
