Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Equivalent of Task Parallel Library in Java

I guess there is no equivalent of task parallel libraries (of .NET 4.0) in Java. Is that true? What are the improvements that this feature of .NET offer that Java concurrency doesn't.

like image 244
Nemo Avatar asked Nov 07 '10 11:11

Nemo


People also ask

What is Task Parallel Library?

The Task Parallel Library (TPL) is a set of public types and APIs in the System. Threading and System. Threading. Tasks namespaces. The purpose of the TPL is to make developers more productive by simplifying the process of adding parallelism and concurrency to applications.

How are threads different from TPL?

Compared to the classic threading model in . NET, Task Parallel Library minimizes the complexity of using threads and provides an abstraction through a set of APIs that help developers focus more on the application program instead of focusing on how the threads will be provisioned.

Are tasks Parallel C#?

Task parallelism is the process of running tasks in parallel. Task parallelism divides tasks and allocates those tasks to separate threads for processing. It is based on unstructured parallelism.

What is parallel class library in C#?

The Parallel class provides library-based data parallel replacements for common operations such as for loops, for each loops, and execution of a set of statements.


1 Answers

Java has the java.util.concurrent package, and there's also the fork/join framework. Fork/join is scheduled for inclusion in Java 7, but can be downloaded now and used with Java 6.

A good book for getting to grips with concurrency in Java is Java Concurrency in Practice, by Brian Goetz and others.

like image 60
Richard Fearn Avatar answered Sep 21 '22 17:09

Richard Fearn