Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to use power of Dual/ Quad core Processors in Applet?

Reply
Thread Tools

How to use power of Dual/ Quad core Processors in Applet?

 
 
Sanny
Guest
Posts: n/a
 
      07-19-2007
I have a large Applet I wish to use Dual/ Quad core Computers to take
advantage of all the 4/ 2 processors they have.

Will the JVM automatically gives each thread devoted to one core or
have to write something to assign different cores to different cores?

Bye
Sanny

 
Reply With Quote
 
 
 
 
Patrick
Guest
Posts: n/a
 
      07-19-2007
Sanny a écrit :
> I have a large Applet I wish to use Dual/ Quad core Computers to take
> advantage of all the 4/ 2 processors they have.
>
> Will the JVM automatically gives each thread devoted to one core or
> have to write something to assign different cores to different cores?


If you write carefully your program with multiple threads, the JVM
should assign them to different cores. But it may also depend of the
operating system.

--
Patrick
 
Reply With Quote
 
 
 
 
Twisted
Guest
Posts: n/a
 
      07-19-2007
On Jul 19, 7:31 am, Sanny <softta...@hotmail.com> wrote:
> I have a large Applet I wish to use Dual/ Quad core Computers to take
> advantage of all the 4/ 2 processors they have.
>
> Will the JVM automatically gives each thread devoted to one core or
> have to write something to assign different cores to different cores?


Just use threads to divide up the computational work in your
application.

 
Reply With Quote
 
Daniel Pitts
Guest
Posts: n/a
 
      07-19-2007
On Jul 19, 5:11 am, Patrick <peuimpo...@quelquepart.fr> wrote:
> Sanny a écrit :
>
> > I have a large Applet I wish to use Dual/ Quad core Computers to take
> > advantage of all the 4/ 2 processors they have.

>
> > Will the JVM automatically gives each thread devoted to one core or
> > have to write something to assign different cores to different cores?

>
> If you write carefully your program with multiple threads, the JVM
> should assign them to different cores. But it may also depend of the
> operating system.
>
> --
> Patrick


Actually, The threads themselves may not be "assigned" to specific
cores, but when a core becomes free, the OS will choose which thread
to schedule on that core. Although the actual algorithm is somewhat
complicated, its fair to say that using multiple threads will give you
a fairly even distribution among the cores, assuming you're using a
modern OS and modern JVM.

 
Reply With Quote
 
Sanny
Guest
Posts: n/a
 
      07-20-2007
> Actually, The threads themselves may not be "assigned" to specific
> cores, but when a core becomes free, the OS will choose which thread
> to schedule on that core. Although the actual algorithm is somewhat
> complicated, its fair to say that using multiple threads will give you
> a fairly even distribution among the cores, assuming you're using a
> modern OS and modern JVM.


Does Unix, Windows 98, Windows XP, Windows Vista, OS/2, Linux etc
support Dual & Quad Processors.

My Applet is for everyone. So I want it to work on every Operating
System.

One more Question does an Applet gets only those resources which
Browser provides? Will it depend also on which browser the user is
using.

Is there a Chart where I can see which Browsers and Operating Systems
support Dual Core/ Quad core Processoors.

And Maximum how many threads can be created for an Applet. Can I
create 100 or 1000 threads running Simultaniously without crashing the
Browser?

JAVA was once a very modern language but I feel it is loosing it's
importance because of Microsoft Monopoly. Why do Microsoft not give
enough support for Java. We see Flash works better than Applets and
faster, While even little Applet takes lot of time to download. Why
Browsers do not support Applet as par as Flash.

Bye
Sanny


 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      07-20-2007
>Will the JVM automatically gives each thread devoted to one core or
>have to write something to assign different cores to different cores?


So long as you have multiple threads, the multiple processors will be
automatically exploited. The JVM does not assign a thread to a
processor. On each slice the OS just gives the highest priority
waiting thread to the first available processor.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      07-20-2007
On Fri, 20 Jul 2007 00:51:15 -0700, Sanny <>
wrote, quoted or indirectly quoted someone who said :

>Is there a Chart where I can see which Browsers and Operating Systems
>support Dual Core/ Quad core Processoors.


You can find out with a simple benchmark than starts N threads to
complete N chunks of compute intensive work. Compare that with the
time to run 1 thread to do N chunks of compute intensive work.

see http://mindprod.com/jgloss/benchmark.html
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
~kurt
Guest
Posts: n/a
 
      07-21-2007
Sanny <> wrote:
>
> Does Unix, Windows 98, Windows XP, Windows Vista, OS/2, Linux etc
> support Dual & Quad Processors.


I know Solaris has supported multiple processors for a long time,
same with Linux. I'm pretty sure Vista and XP do because I remember
having support for dual processors even with NT.

- Kurt
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      07-21-2007
On Sat, 21 Jul 2007 01:49:54 GMT, ~kurt <>
wrote, quoted or indirectly quoted someone who said :

>I'm pretty sure Vista and XP do because I remember
>having support for dual processors even with NT.


Duals have been supported since NT days, but I don't know about Quads.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
pkriens
Guest
Posts: n/a
 
      07-21-2007
On Jul 20, 10:17 am, Roedy Green <see_webs...@mindprod.com.invalid>
wrote:
> >Will the JVM automatically gives each thread devoted to one core or
> >have to write something to assign different cores to different cores?

>
> So long as you have multiple threads, the multiple processors will be
> automatically exploited. The JVM does not assign a thread to a
> processor. On each slice the OS just gives the highest priority
> waiting thread to the first available processor.
> --
> Roedy Green Canadian Mind Products
> The Java Glossaryhttp://mindprod.com

Are you sure about this? Due to the problems with multi-core memory
models I would expect a lot of Java code to fail due to lack of proper
synchronization (which also handles memory synchronization between
CPUs). I think some OSs have an affinity for a single CPU, at least I
would not assign an application to multiple cores at the same time
unless I was told the application could live in a multi-core world.

Kind regards,

Peter Kriens

 
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
2 Dual Core 3Ghz Xeon or 2 Quad Core 2.33Ghz Xeon? Adrian Windows 64bit 5 03-19-2007 07:40 PM
When to pick quad core and when to pick dual core thingy NZ Computing 6 11-21-2006 07:08 AM
AMD quad-core - even 16-core!! GraB NZ Computing 2 06-16-2005 11:38 PM
Support for Quad processors or two dual core opertions.. =?Utf-8?B?LS0gSmFtZXMgLS0=?= Windows 64bit 13 06-11-2005 02:02 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57