• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

need more skill on dual cpu system?

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just have aquestion.
Do I need do more on dual cpu system?
Does it run faster for single thread or more threads?

Just want to know,hehe

thanks!
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my opinion:

If you have no other applications taking up processor time, then a single-thread application will probably run at the same speed on one processor or two. However if other applications take up time, then a single-threaded application will probably benefit from two processors, because the other applications can run on one processor while your single thread takes the other processor. It has to do less sharing that way.

If you have a multi-threaded application, it's much more likely to run faster on two processors. Assuming the threads aren't spending most of their time waiting or blocking for some reason.

In general, writing multithreaded code takes more skill than single=threaded code. I don't think the number of processors makes much difference here. But there may be exceptions.
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In terms of Java each CPU would be running a separate JVM (normally). So multi-threaded code doesn't change. However if you design your application for multiple processors you are going to have to partition the workload somehow. In the simplest case each processor does exactly the same thing, just on different data (so some coordination may be required). In the more complicated case you are going to have to partition your task into multiple stages, where some of these stages have to happen in serial, while others can happen in parallel. The parallel stages you can distribute over multiple processors. However this requires that those stages communicate past the JVM/Process boundaries � so you have to employ inter-process communication (IPC) through shared memory, sockets, pipes, etc. Ultimately IPC can introduce blocking behavior and overhead that may negate any advantage that you may have gained from distributing the processing over multiple processors.

So yes, you will need more skill to develop a multi-processor (parallel) application and you need good judgment to decide whether the application of heterogeneous parallel processing is going to help.
[ May 19, 2006: Message edited by: Peer Reynders ]
 
If you are using a rototiller, you are doing it wrong. Even on this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic