The Evolution of Java Parallel Programming

estrapadesherbetΛογισμικό & κατασκευή λογ/κού

18 Νοε 2013 (πριν από 3 χρόνια και 9 μήνες)

95 εμφανίσεις

The Evolution of
Java Parallel Programming


ChingYing Kuo

Computer Science Department

San Jose State University

San Jose, CA 95192

408
-
568
-
5758

Kuo199976@hotmail.com












ABSTRACT

Parallel processing has never had easy solutions.
However, Java of
fers faster and easier ways to
accomplish such a challenge in software level. I would
like to discuss about the progress of java parallel
processing and associate efficiency improvement.
Also, the frameworks are related to java parallel
processing.

1.

INTRODU
CTION

Traditionally, parallel processing is done by complicate
design of instructions of hardware processor.
However, software engineers developed many
frameworks to handle parallel processing in software’s
prospective. In Java

SE5
, the innovation started
from
multithreading

support
. Then
, engineers developed
Java SE6

concurrent

package for better support
concurrency management. Now, the Java
SE7
introduced

fork and joint framework which fully
support parallelism.

Also, based on fork and joint
framework, an
other framework called JPPF is
introduced. Therefore, I would like to discuss the
evolution of Java parallel processing.

2.

Current Trend of Parallel Computer
Architectures


Shared memory multiprocessor (SMP) parallel
computers


Standard programming API: Open
MP
[3]



Figure 1. [3]

Cluster parallel computers


Standard programming API: Message Passing
Interface (MPI)

[3]





Figure 2. [3]

These are the two main parallel computer
architectures in recent time. Java parallel processing
have sol
utions for both of the architectures.


3.

Java Multithreading Era

In Java SE 5, it offers threading package to perform
multithreading. By using this pack
age, programmers
can improve computation

efficiency
. However,
programmers have to make sure

the program fo
llows
a correct and consistent way to handle shared objects,
and they have to avoid incorrect read/write operations
without deadlocks caused by race conditions.
[2]

Threading package
does not provide synchronization
capabilities. Programmers still have to u
se notify() and
wait() methods from java.lang.Object package. It
causes problems when programmers mishandling
synchronization and slows productivity.

4.

Java concurrency Era

4.1

Is this much better than multithreading?

In Java SE 6, the concurrency package offer
s a much
better solution to perform multithreading. It has

Executors” which gives a much better thread pool
handling and scheduling strategies.
When passing
shared data between concurrent processes, a Thread
-
safe queue will provide better data exchange

me
thod
to reduce the existence of deadlock. A time
-
out delay
enhancement will give a
better recovery for interrupted
tasks. Lastly, enhanced synchronization patterns will
provide

higher quality synchronization strategies over
mutual exclusion.

4.2

How much eff
iciency boosted over
multithreading?

Suppose there are 50 tasks need to be computed,
each task will sleep for 1 second. The resulting time
will take 65.298 seconds to complete the tasks by
using old multithreading computation method.

Figure. 3[1]

However
, when the same tasks perform by using
concurrent package, it takes only take

16.73 seconds
to completes the tasks.





Figure. 4[1]

It’s a 75 percent efficiency increase. The result is
based on concurrent process of eight pool threading.

5.

Java fork and
joint Era

5.1

What is the advantage of for and joint?

The core difference is thread pool enhancement
called ForkJoin Pool. It dedicates
to run instances
which implements ForJoinTask.

ForJoinTask objects
support subtask management.
Executor

can then able
to ta
ke away jobs when it’s waiting for other task to
complete with safety enhancement.

5.2

How much faster than concurrent process?

By performing the same task in Figure 4, the process
uses fork and joint framework to implement same
computation. It takes 11.045
seconds to complete the
tasks. It’s an 83 percent efficiency increase.


Figure. 5[1]

6.

Java
p
arallel processing solution for multiple
node

(The Cloud)

6.1

What is JPPF?

JPFF is the acronyms of java parallel process
framework.

It

gives applications with large pr
ocessing
power requirements to be run on any number of
nodes, in order to greatly reduce the processing time.
By splitting an application into smaller parts, it can be
executed simultaneously on different machines.[5]

6.2

How it works?

First, it divides an app
lication into smaller ones that
can be executed independently and in parallel. This
gives rapid computation power. Second, JPPF Grid
executes the application. JPPF Grid is built by a
server which connects with any number of nodes to
give the computation p
ower.[5]

6.3

What are the advantages?

1.

Ease of installation and configuration can
enhance

programmers
’ productivity.

2.

Java framework support multiple platform

3.

Single deployment with multiple nodes to
process the application by using JPPF Grid
technology

6.4

What is

the architecture?

JPPF basically consists of three parts: client, server
and nodes. Programmers or users submit tasks to
server, and then the server will break the task to
subtasks and submit to nodes. Nodes will compute
the subtasks and send back to the
server. Server then
intergrade the results and deliver to client.


Figure. 6[5]


Figure. 7[5]

6.5

How does the node communicate?

JPFF use synchronous method to exchange date
through network. In JPPF grid, three components do
requ
est and response in rapid sp
eed to fulfill each
node’s requirement for computing.


Figure. 8[5]

6.6

How does the resource handle in parallel?

At the client level: It performs
single client, multiple
concurrent jobs or multiple clients, multiple concurrent
jobs. The clients can also perf
orm mixed local and
remote execution.[5] This requires a load balancing
mechanism to handle.

At the server level: It plays the most essential part.
The Parallelism will be performed based on several
factors such as client numbers, node numbers, load
-
balanc
ing, job service level agreement, and parallel
I/O.

At the node level: each node will perform
multithreading. The performance depends on the java
frameworks. For instance, the programmer can
choose to use java concurrent package or for and joint
framework
.

7.

Conclusion

Java has been a very powerful language ever since it
was created. Within dedicated work by talented
engineers, it gets more and more powerful to catch up
the speed of technology evolution.

Java parallel
processing not only boost single node’s
computing
power, but also boost up the computing power to fulfill
the requirements for cloud computing. I believe Java
parallel processing will lead to next generation’s
technology revolution.

8.

References

[1]

Parallel Processing and Multi
-
Core Utilization with
Java
.

http://embarcaderos.net/2011/01/23/parallel
-
processing
-
and
-
multi
-
core
-
utilization
-
with
-
java/

[2]

Fork and Join: Java Can Excel at Painless
Parallel Programming Too!
http://www.oracle.com/technetwork/articles/java/fo
rk
-
join
-
422606.html.

[3]

Alan Kaminsky, PAR
ALLEL PROGRAMMING IN
JAVA, 2007, CCSCNE 2007 Conference
.

[4]

Lars Vogel, Java concurrency (multi
-
threading)


tutorial, 2013
.

http://www.vogella.com/articles/JavaConcurrency/
article.html#concurrency_processthreads
.

[5]

JPFF Documentation
http://www.jppf.org/doc/v3
/index.php?title=JPPF_
Overview