Java multi CPU capabilities

ted leslie ted.leslie-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Thu Aug 29 03:55:31 UTC 2013


Don't use Java, just c# now a days.
Do you have a small test program or something you can post?
-tl



On Wed, Aug 28, 2013 at 9:22 PM, William Muriithi
<william.muriithi-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:
>
>> ps and top by default only show process not threads. There is opts to show
>> threads. In mono I have written program that showed many 100s threads on a
>> process and utilizing 4 cores.
>>
> Actually you are correct pstree. There even flags on PS to display the
> threads.
>
> That being said,  a default Java setup seem to trigger outage if the CPU hit
> 100%. Since most of the system have 4 CPU that shouldnt be the case till
> around 400%
>
> Isn't this correct or am I wrong here too?
>
>
>> Maybe there is some reason the hardware you are working on wants to be
>> super thread safe or something. I know gui are usually single threaded to
>> prevent a lot of foot shooting.
>> I would guess Java has been able to do multi thread concurrent on
>> multicores for over 10 years. C# could and back then Java was more powerful
>> in just about every way over c#. Definitely not the case now however.
>> .tl
>>
> Interesting, you are petty lucky then. I don't think that's happening in my
> case and from what I can tell by extensive Googling, its a problem to a lot
> of people.
>
> Do you mind sharing the Java options you are using please?  I could play
> around with it tomorrow and see what happen
>
> William
>
>> On Aug 28, 2013 8:03 PM, "William Muriithi" <william.muriithi-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>
>> wrote:
>>>
>>>
>>> > java is NOT the application.  It is the language and runtime for the
>>> > application.
>>> My bad. Agree, that a serious error on my side.
>>>
>>> >If an application wants to use multiple CPUs, then the
>>> > author of the application should write a threaded application.
>>> >
>>> But how do you achieve that if your application is restricted without a
>>> container that is only single kernel threaded?
>>> > There is certainly research into making runtimes and languages that
>>> > can automatically make some parts of the code run in parallel, but that
>>> > isn't something you are likely to see in current production systems.
>>> >
>>> That seem to be the case
>>>
>>> > So if your application written in java creates multiple threads, then
>>> > it will use multiple CPUs just fine.
>>> >
>>> Not necessary.  Sure, you can have as many threads as you want in the
>>> container, but if that container just make a single kernel thread, you
>>> wouldn't be able to sprend the thread across more than one CPU.
>>>
>>> That's what I am observing on both openjdk and sun Java.
>>>
>>> Casually check any server running Java based system and you will see the
>>> whole application look like a single process to the operating system.  How
>>> do you explain that?
>>> > --
>>> > Len Sorensen
>>> > --
>>> William
>>> > The Toronto Linux Users Group.      Meetings: http://gtalug.org/
>>> > TLUG requests: Linux topics, No HTML, wrap text below 80 columns
>>> > How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list