comp.lang.ada
 help / color / mirror / Atom feed
From: David Marceau <davidmarceau@sympatico.ca>
Subject: Re: Help: Problem with JGnat
Date: Fri, 02 Aug 2002 14:55:17 -0400
Date: 2002-08-02T14:55:17-04:00	[thread overview]
Message-ID: <3D4AD595.A224558C@sympatico.ca> (raw)
In-Reply-To: 3d4aae3a$1_1@rcfnews.cs.umass.edu

What about trying to turn the JIT compiler off? There's a
switch/environment variable for this in the jdk docs.
That's how it could work with jdk 1.3.  You have to turn the jit
compiler off.  In this mode it's as if it was running the jdk 1.2.2
compiler :)
It's also good to do this when debugging just java IMHO.

Bin Chen wrote:
> 
> Thank you very much.
> 
> Bin
> 
> "Marc A. Criley" <mcq95@earthlink.net> wrote in message
> news:3D4A7C39.2AF0BA8@earthlink.net...
> > "Dr. Michael Paus" wrote:
> > >
> > > Bin Chen wrote:
> > > > Hi,
> > > >
> > > > I used jgnat compile the following Ada program to Java bytecode, it
> was OK,
> > > > but when I ran the .class file, it always threw the following
> exception.
> > > > Could you give me any feedback?
> > >
> > > Which version of Java are you using? JGNAT does not work on recent Java
> > > distributions anymore unless there is  a newer version than the one I
> have.
> > > (1.1p). See also the comment on http://www.gnuada.org/rpms313p.html
> about
> > > JGNAT.
> >
> > Yep, JGNAT 1.1p works (mostly) fine with with JDK 1.2.2, but tasking is
> > broken when used with JDK 1.3.  And I've not tried it with JDK 1.4, but
Hmmm. I remember looking at the jgnat sources and IMHO ACT mapped every
ada task to a java Thread class and not the Runnable Class.
In the HPCJ(High Performance Computing with Java) book, the author
mentioned a flaw with Thread class.
The Thread once started and then after finishing the contents of the
run() would pretend to be garbage collected but it's not.  Which means
if you run 300000 Thread.run()'s you're bound to have a memory/resource
leak issue since the Thread objects are really only garbage collected
when the entire main() process is exited.  This HPCJ book suggests using
a Thread pool which are expected to exist throughout the process
lifetime.  As soon as one Thread is terminated, you may assign another
Runnable to it hence saving resources.i.e Thread pool of say 10000
Threads.  Instantiate and Thread.setTaskRunnable(new adaRunnable(XXX));
and then thisthread.start();  In this manner, it could be a bit more
resilient to memory/resource issues :)  Runnable objects are garbage
collected as expected. Thread objects are not.  I wonder if this has
something to do with the jgnat Tasking being broken?

Cheers,
David Marceau



  reply	other threads:[~2002-08-02 18:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-02  2:46 Help: Problem with JGnat Bin Chen
2002-08-02  8:04 ` Dr. Michael Paus
2002-08-02 12:29   ` Marc A. Criley
2002-08-02 16:04     ` Bin Chen
2002-08-02 18:55       ` David Marceau [this message]
2002-08-02 18:37     ` Robert Dewar
2002-08-02 19:38     ` JGNAT status??? (was: Re: Help: Problem with JGnat) Britt Snodgrass
2002-08-03  8:45       ` Dr. Michael Paus
2002-08-03 11:31         ` David Marceau
2002-08-03 14:36         ` Robert Dewar
2002-08-03 15:38           ` Dr. Michael Paus
2002-08-04 14:18             ` Robert Dewar
2002-08-12 13:23           ` JGNAT status??? (Volunteers?) António Vargas
2002-08-12 23:47             ` Robert Dewar
2002-08-13  2:00             ` Robert C. Leif
2002-08-13  8:23               ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
2002-08-02  4:35 Help: Problem with JGnat Bin Chen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox