Thread implementation on Java for Linux

H

hiwa

Here's a quote from _Java Concurrency in Practice_
by Goetz et al.

<quote>
.... However, operating system support for larger
numbers of threads has improved significantly,
making the thread-per-client model practical even
for large numbers of clients on some platforms.
The NPTL threads package, now part of most Linux
distributions, was designed to support hundreds
of thousands of threads. Nonblocking I/O has its
own benefits, but better OS support for threads
means that there are fewer situations for which
it is essential.
</quote>

Then, my question is, does the thread implementation
on Java for Linux utilize NPTL? Or, even on Linux,
shoud a scalable server development use java.nio
facilities instead of multi-threading?
 
R

Robert Klemme

hiwa said:
Here's a quote from _Java Concurrency in Practice_
by Goetz et al.

<quote>
... However, operating system support for larger
numbers of threads has improved significantly,
making the thread-per-client model practical even
for large numbers of clients on some platforms.
The NPTL threads package, now part of most Linux
distributions, was designed to support hundreds
of thousands of threads. Nonblocking I/O has its
own benefits, but better OS support for threads
means that there are fewer situations for which
it is essential.
</quote>

Then, my question is, does the thread implementation
on Java for Linux utilize NPTL?

I don't know but I'd suspect not if it's not part of / supported by the
standard kernel.
Or, even on Linux,
shoud a scalable server development use java.nio
facilities instead of multi-threading?

That depends on the application. It might be sufficient to limit the number
threads created by using some form of light weight processing framework
(i.e. create a number of threads that fetch their tasks from a queue).

Kind regards

robert
 
C

Chris Uppal

hiwa said:
Then, my question is, does the thread implementation
on Java for Linux utilize NPTL?

I get the impression that it has no choice in the matter -- that NPTL is part
of the kernel and so if you create threads on an NPTL-enabled machine (2.6
kernel) they will be NPTL threads whether you ask for them or not. I could be
completely wrong though. This article has a reasonable discussion:
http://linuxdevices.com/articles/AT6753699732.html

Looking at the 1.5.0 VM source for Linux, there are many NPTL-related comments,
and some NPTL-aware code, so it would seem that the JVM execpts to use NPTL
where it's available.

Or, even on Linux,
shoud a scalable server development use java.nio
facilities instead of multi-threading?

No idea ;-) If I had to, I'd guess that NIO is better than threads, if only
for platform portability.

-- chris
 
H

hiwa

Chris Uppal ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸:
I get the impression that it has no choice in the matter -- that NPTL is part
of the kernel and so if you create threads on an NPTL-enabled machine (2.6
kernel) they will be NPTL threads whether you ask for them or not. I could be
completely wrong though. This article has a reasonable discussion:
http://linuxdevices.com/articles/AT6753699732.html

Looking at the 1.5.0 VM source for Linux, there are many NPTL-related comments,
and some NPTL-aware code, so it would seem that the JVM execpts to use NPTL
where it's available.



No idea ;-) If I had to, I'd guess that NIO is better than threads, if only
for platform portability.

-- chris
Thanks. Chris has given a best model reply, I think.
We should do or find stress tests on NPTL.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top