Is a multi-threaded algorithm required to use multi-core processors?

I'm just wondering if we need an algorithm that should be muti-threaded if it should use multi-core processors or will jvm with multiple cores be used, although our algorithm is sequential?

UPDATE:

Related question:

  • Muti-Threaded quick or merge sort in java
+8
java multithreading multicore
01 Oct '10 at 6:17
source share
4 answers

I do not believe that any current, production JVM implementations do automatic multithreading. They may use other cores to collect garbage and some other households, but if your code is expressed in a consistent manner, it is difficult to automatically parallelize it and still maintain accurate semantics.

There may be experimental / research JVMs that try to parallelize areas of the code that the JIT may perceive as embarrassing parallels, but I have not heard of such scenarios for production systems. Even if the JIT noticed this, it would probably be less efficient than developing code for parallelism in the first place. (By writing code sequentially, you can easily end up making design decisions that will prevent automatic parallelism from being unintentionally.)

+16
01 Oct '10 at 6:20
source share

Your implementation must be multithreaded to take advantage of the multiple cores at your disposal.

Your system as a whole can use one core for each application or service. However, each running application will work with one thread / kernel, unless otherwise implemented.

+4
01 Oct '10 at 6:28
source share

I do not think that using a multi-threaded algorithm will efficiently use multi-core processors if it is not encoded for efficiency. Here's a good article that talks about using multi-core processors for developers -

http://java.dzone.com/news/building-multi-core-ready-java

+1
01 Oct '10 at 6:21
source share

Java will not automatically split your program into threads. Currently, if you want your code to work on several cores at once, you need to tell the computer through threads or some other mechanism how to break the code into tasks and dependencies between tasks in your program. However, other tasks can be performed simultaneously on other cores, so your program can run faster on a multi-core processor if you use other functions at the same time.

An easy way to make your current paralyzed code is to use JOMP to parallelize for loops and increase the processing power of the easily paralleled parts of your code.

+1
Oct 01 2018-10-10T00:
source share



All Articles