Is there any library like Intel TBB in Java which support Parallelism.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Perhaps you could clarify what exactly you are looking for
This is what the concurrency libraries have done since 1998 and were made part of Java 5.0 in 2004.
EDIT: Say you want a thread pool which can use all the logical processors on your system.
This will performs doWork on each free thread.
Looking at its features they look very familiar.
I had a look at some of the low level optimisations like thread aware memory allocation. In Java this is called TLAB (Thread Local Allocation Buffers) and is transparent. I suspect most Java developers don’t even know they exist.
Results and Exceptions are captured for you in a Future object which you can inspect later.
You can have “condition variables” such as CountdownLatch or CyclicBarrier
Java’s ConcurrentHashMap supports the ConcurrentMap and Map interfaces, permits concurrent insertion and traversal and does not expose any locks. 😉 It is at least 9 years old so you know it should be robust and stable.
There is a PriorityQueue which you can use in you thread pool if you wish.