This is the mail archive of the
mailing list for the GCC project.
Re: [gcj] Priority setting
- From: David Daney <ddaney at avtrex dot com>
- To: NightStrike <nightstrike at gmail dot com>
- Cc: Andrew Haley <aph-gcc at littlepinkcloud dot com>, gcc-help at gcc dot gnu dot org
- Date: Thu, 01 Nov 2007 10:24:08 -0700
- Subject: Re: [gcj] Priority setting
- References: <email@example.com> <firstname.lastname@example.org> <email@example.com>
On 10/19/07, Andrew Haley <firstname.lastname@example.org> wrote:
> Does gcj support setting priorities for threads in a java process?
Yes, it does. It passes the priority down to the underlying thread system.
What is the underlying thread system? Does it incorporate pthreads,
or some other thing?
On linux, java threads are based on the underlying pthread implementation.
> Also, is garbage collection preemptible?
You'll have to explain what you mean by that.
In a Sun virtual machine environment, garbage collection can run at
any arbitrary time, and there is nothing that the application can do
to prevent this. In the case of timing-critical applications, the
user is at a loss, and thus there can be no determinism in that
environment. I am looking to see how well gcj can perform as an
avenue for real time deterministic java applications.
Boehm GC, which is used in libgcj, functions similarly. The good news
is that it is open source, so you can adapt it to your needs. For
example you can dynamically change the free_space_divisor parameter to
influence the decision of weather to allocate more memory or run the GC.
However it might be difficult to guarantee hard real time.