multithreading - how to execute a java program on several cores? -
I had a Java program that I run thousand times based on loop (number of files compiled to create According to a Linux kernel).
There was a demonstration problem because jvm was started multiple times ...
What I have done is implementing a cover in Java, it is similar to my bass script It reads a line from a file and then makes the main call to my previous program ... In this way, I only have one jvm running ...
The problem is now that my box Only one core is used which is another display problem ... do i have some threads Do I have to do or can I use the same method, but perhaps the "ex" can call the main in a different way? If I have to start some threads, how do I transmit them across many core?
Thank you ...
Your Java program needs to be multi-threaded , To take advantage of several cores. For example, create a thread pool using java.util.concurrent.Executors, explain your data items as runnables, and submit threadnables to Thunderpool.
Comments
Post a Comment