Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Tomcat Multi-Threading

Reply
Thread Tools

Tomcat Multi-Threading

 
 
Lew
Guest
Posts: n/a
 
      02-01-2013
Magnus Warker wrote:
> Lew wrote:
>> Magnus Warker wrote:
>>> Lew wrote:

>
>>>> The JVM is multi-threaded and has, what, a minimum of four? at any rate severa; threads running
>>>> even if the application only uses one of them.

>
>>> There is a mistake in your logical conclusion: Even if the VM is
>>> multi-threaded, the applications running on top of them may still be
>>> single-threaded. So your statement ("no applications are single
>>> threaded") is simply wrong.

>
>> 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.

>> I guess you decided to ignore it in order to snark, huh?

>
> 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.

--
Lew

 
Reply With Quote
 
 
 
 
Arne Vajh°j
Guest
Posts: n/a
 
      02-01-2013
On 2/1/2013 2:23 PM, Lew wrote:
> Magnus Warker 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.


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

 
Reply With Quote
 
 
 
 
Arne Vajh°j
Guest
Posts: n/a
 
      02-01-2013
On 1/31/2013 3:47 AM, lipska the kat wrote:
> On 31/01/13 03:21, Arne Vajh°j wrote:
>> On 1/30/2013 5:48 PM, Lew wrote:
>>> 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


 
Reply With Quote
 
Magnus Warker
Guest
Posts: n/a
 
      02-03-2013
On 02/01/2013 08:23 PM, Lew wrote:
> Magnus Warker wrote:
>> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Which JVM to use for Tomcat 5.0.28 and Tomcat 5.5.4? Katerina McLean Java 1 12-10-2004 10:55 PM
Tomcat 4.1.31 - huge count of webapps, Tomcat hangs up Martin Eberle Java 2 12-03-2004 07:10 PM
Tomcat Web application manager - Virtual host Tomcat 4.30 + Apache2 + JK2 connector with multi IPs Joe Java 0 07-12-2004 03:06 PM
Apache Tomcat 4.1.24: problem with Tomcat Administration link Christos Gravvanis Java 0 07-07-2004 05:21 PM
[TOMCAT] Tomcat crashes %=zerointeractive.it% Java 1 01-22-2004 12:08 PM



Advertisments