Tomcat Multi-Threading

L

Lew

Magnus said:
Even more important, the OP wants to know if multiple CPUs will help performance of a
Java app if it's multithreaded. Since the app runs in a multi-threaded context, if multiple
CPUs would speed up a multi-threaded app, they'd help *any* Java app. I made this point
upthread;

I can only repeat what others already pointed out:
Indeed.

You are confusing multi-threading in java applications and processes
that are multi-threaded from the os [sic] perspective.

No, I am not. I am referring to the fact that the Java application is multi-threaded
from the OS perspective. No confusion involved.
This is your job.

Let's try again. The OP wants to know if multiple CPUs will help an app.

Now they were talking about Tomcat, in which the container is multi-threaded
but the app you write is not. Sorta parallel, huh?

But everyone agrees that the presence of multiple threads in the parent engine
means that the question of hardware speedup pertains.

Same with the JVM. The presence of multiple threads in the application, notwithstanding
that they are part of the application's execution environment as with Tomcat, and
not in the app itself (follow along now - this is the hard part), means that any influence
of multiple CPUs on multiple threads will pertain.

So the fact that these threads are part of the JVM's infrastructure and not in the
mental model of the app itself is utterly irrelevant.

As would be obvious to you were you paying attention and able to follow along.

I gave you the benefit of the doubt with respect to those assumptions. Ergo, I
conclude that the logic of my point has not escaped you. Ergo, I conclude you
have another motive for disagreeing publicly. I only can think of one such motive,
the desire to snark.

So I conclude on the evidence that the purpose of your response is to snark.

Otherwise I have to conclude that you have diminished capacity, and I do not believe that.
 
A

Arne Vajhøj

Magnus said:
You are confusing multi-threading in java applications and processes
that are multi-threaded from the os [sic] perspective.

No, I am not. I am referring to the fact that the Java application is multi-threaded
from the OS perspective. No confusion involved.

Pretty confusing that the fact that such an application becomes
multi threaded by the fact that there exist a JVM that creates more
threads.

That is not a common definition of multi threaded.

As the same Java application can run on many different JVM's and OS'es,
then I don't see a Java application being anything from OS perspective.

AFAIK then the Java specifications does not even require threads at
the OS level.

Arne
 
A

Arne Vajhøj

lipska the kat wrote:
Lew wrote:
[snip]

What we are skeptical about is you claim that all Java apps
are multi threaded. That seems to be based on a rather unsual
definition of multi threaded.

I think this is the point. What exactly is a multi-threaded application.

The OP asked a question re Tomcat

When you write a web app you have no conventional Java entry point
(public static void main(String[] args), you are actually extending the
server. IIRC the Tomcat docs explicitly advise against instantiating new
threads. I don't think that anyone would argue against the fact that
*Tomcat* is a multi-threaded application. Does this make your web-app
multi-threaded ... Well yes it does but only as a *side effect* of the
way the container manages multiple requests for the same resource, if
you extend a multi-threaded application then by implication your
application is multi-threaded.

That's my view of things anyway.

Applications with a single public static void main(String args[]) entry
point are different. If you don't explicitly create new Threads then I
don't think you would call your application multi-threaded. The fact the
the JVM uses multiple threads to do houskeeping tasks is an
implementation detail. The clincher is that the JVM isn't a Java
application (in the way that Tomcat is). There is a difference of course
between green and native threads but that discussion is beyond the scope
of this document :)

Or maybe you disagree

I don't think there is much disagreement about the Tomcat web app.

The discussion is whether all Java apps are multi threaded.

And I think we agree on that topic.

Arne
 
M

Magnus Warker

Magnus said:
Lew wrote:
You are confusing multi-threading in java applications and processes
that are multi-threaded from the os [sic] perspective.
No, I am not. I am referring to the fact that the Java application is multi-threaded
from the OS perspective. No confusion involved.

The OS does not see any "java applications".
So the fact that these threads are part of the JVM's infrastructure and not in the
mental model of the app itself is utterly irrelevant.

The multi-threading ability is no absolute ability, but it's relative to
some context. A java application does not automatically become
multi-threaded, just because its environment process runs multiple
threads from the os perspective.
So I conclude on the evidence that the purpose of your response is to snark.

This is your job.

Magnus
 

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

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top