This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

need more skill on dual cpu system?

 
Jimmy Chen
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • 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!
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Peer Reynders
Bartender
Posts: 2938
5
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic