How multi processing is achieved in JAVA?

Answer Posted / sharjith n.

First of all, MultiProcessing is different from
MultiThreading. In MultiThreading the same processor
executes the different threads. However there is no
parallel processing of any thread done because finally, one
processor can handle only one task at a time. You feel the
computer is doing many tasks together because of the very
small amount of time between task switching but the
processor is actually doing only a single task. But how
fast the processor is completing all the queued tasks
depends upon the major factor that is the clock speed and
many others too. But when you employ more than one
processor, as in Servers with Multiple CPUs or in the
latest Core2Duo or Core2Quad machines, MultiProcessing
(technically known as Parallel Computing) comes into
picture, where each thread of the same process is assigned
to different processors (or cores in case of the multi core
architectures) using fork-and-join method. In this case two
threads of the same process is parallely executed by two
processors (in case of 2 processors). In C/C++ Parallel
Processing (MultiProcessing ) can be achieved by using the
OpenMP library which is shipped with the latest Visual
Studio compilers and the other compilers like GNU v4.2 and
above and IBM and Intel compilers. You have to write the
programs using the appropriate #pragma statements to fork
and join for loops and also compile the programs with
special flags. Multiple processor or multicore cpus are
useless unless the software you write utilizes them.
My answer does not tell you how to do the same in Java but
you will definitely understand what to search for i.e.
libraries supporting MultiProcessing in Java.

Is This Answer Correct ?    5 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by an object in java?

891


Explain about transient variables in java?

870


Can we sort set in java?

761


What is the multi-catch block in java?

808


How does a cookie work in Servlets?

612


what is meant by encapsulation?

870


What are the characteristics of Final,Finally and Finalize keywords.

951


What is a consumer in java?

797


What is the main function in java?

828


what is deadlock? : Java thread

760


Explain static nested classes ?

837


What is difference between static variable and global variable?

804


what is ststic with example

1815


What is the meaning of course?

857


whar are the draw backs of programming lang step by step in Clang and next in C++ and next and in Java nad in .Net

1905