fork-join Questions
1
Solved
I have a simple question on using the fork join thread pool. Here is a short example of what I'm using:
executor = "fork-join-executor"
# Configuration for the fork join pool
fork-join-executor...
Commoner asked 10/5, 2016 at 8:58
1
Solved
I'm new to Java and is trying to learn the concept of high level concurrency. I saw this code at Java Tutorial Oracle. However, when I run the code, the IDE output an image that is entire black. Wh...
Toiletry asked 22/2, 2016 at 0:42
3
Solved
I came across a strange situation where using a parallel stream with a lambda in a static initializer takes seemingly forever with no CPU utilization. Here's the code:
class Deadlock {
static {
...
Siward asked 15/1, 2016 at 21:22
2
Solved
Is it possible to configure ForkJoinPool to use 1 execution thread?
I am executing code that invokes Random inside a ForkJoinPool. Every time it runs, I end up with different runtime behavior, mak...
Sporting asked 1/12, 2015 at 3:34
2
What does Async mode of ForkJoinPool mean? Javadoc mentions that it makes queues (is it per-thread queue?) FIFO instead of LIFO. What does it mean in practice?
Trenchant asked 12/4, 2011 at 18:42
1
Solved
I was reading Java ForkJoin framework. What extra benefits are there by not directly call invoke() on an implementation of ForkJoinTask (e.g. RecursiveTask), but to instantiate ForkJoinPool and cal...
Clinic asked 7/12, 2015 at 11:20
7
Solved
The event-driven programming model of node.js makes it somewhat tricky to coordinate the program flow.
Simple sequential execution gets turned into nested callbacks, which is easy enough (though a...
Dav asked 8/1, 2011 at 1:21
1
In a ForkJoinPool ForkJoinTask, does the current worker thread participate in work stealing?
I have read implications that a fork join pool can work steal from blocked or waiting threads. The curr...
Alcala asked 15/10, 2015 at 1:3
1
Normally when one uses Java 8's parallelStream(), the result is execution via the default, common fork-join pool (i.e. ForkJoinPool.commonPool()).
That is clearly undesirable, however, if one has ...
Sherlynsherm asked 1/10, 2015 at 15:39
3
Question
As Fork-Join seems to be the current hype and recommended in many answers, I thought: why not do some research on how fast it actually is?
To measure this, I wrote a small program (see c...
Lingulate asked 29/11, 2013 at 14:52
1
Solved
I understand that there is overhead in setting up the processing of a parallel Stream, and that processing in a single thread is faster if there are few items or the processing of each item is fast...
Cozy asked 12/8, 2015 at 19:56
3
Solved
Here's my understanding of the Stream framework of Java 8:
Something creates a source Stream
The implementation is responsible for providing a BaseStream#parallel() method, which in turns returns...
Sultana asked 8/7, 2014 at 10:15
1
In Scala you can use a global ExecutionContext if you don't need to define your own by importing scala.concurrent.ExecutionContext.Implicits.global.
My question is why ForkJoinPool was chosen for ...
Carpetbag asked 17/7, 2015 at 1:11
2
Solved
I have a custom ForkJoinPool created with parallelism of 25.
customForkJoinPool = new ForkJoinPool(25);
I have a list of 700 file names and I used code like this to download the files from S3 in...
Birchfield asked 12/6, 2015 at 22:15
1
Solved
I want to submit Runnable tasks into ForkJoinPool via a method:
forkJoinPool.submit(Runnable task)
Note, I use JDK 7.
Under the hood, they are transformed into ForkJoinTask objects.
I know tha...
Raynell asked 5/5, 2015 at 7:52
1
Solved
I need to block threads on ForkJoinPool when its queue is full.
This can be done in the standard ThreadPoolExecutor, e.g.:
private static ExecutorService newFixedThreadPoolWithQueueSize(int nThrea...
Gambrinus asked 30/4, 2015 at 8:13
1
Solved
I read a great article about the fork-join framework in Java 7, and the idea is that, with ForkJoinPool and ForkJoinTask, the threads in the pool can get the sub tasks from other tasks, so it's abl...
Uveitis asked 1/5, 2015 at 14:25
2
Solved
I'm procesing data using latest Java 8 lambdas with parallel streams.
My code is following:
ForkJoinPool forkJoinPool = new ForkJoinPool(10);
List<String> files = Arrays.asList(new String[]{...
Minimum asked 7/9, 2014 at 1:14
2
My program searches for a solution (any solution) to a problem through a divide-and-conquer approach, implemented using recursion and RecursiveTasks's: I fork a task for the first branch of the div...
Hightoned asked 26/5, 2014 at 11:26
1
I have a recursive divide and conquer algorithm that requires two computationally intensive base case tasks before starting the dividing. The initial base cases are independent tasks, so I want to ...
Divide asked 21/3, 2014 at 6:22
3
What I want
I want to work on optimization of fork/join algorithm. By optimization I mean just calculation of optimal number of threads, or if you want - calculation of SEQUENTIAL_THRESHOLD (see c...
Critique asked 5/3, 2014 at 7:32
4
After looking the Fork/Join Tutorial, I created a class for computing large factorials:
public class ForkFactorial extends RecursiveTask<BigInteger> {
final int end;
final int start;
pri...
Gallicism asked 24/11, 2013 at 17:11
1
We're making some good progress in load testing and scaling an akka application but we're seeing scala.concurrent.forkjoin.ForkJoinPool.scan() coming up as the second highest hotspot around 20% of ...
Maugham asked 2/10, 2013 at 21:23
2
Solved
What is the key difference between Fork/Join and Map/Reduce?
Do they differ in the kind of decomposition and distribution (data vs. computation)?
1
Solved
I have got the following class which runs and compiles (you can try it out). The only thing puzzles me a little is that at the end in the main it works fine with fj.invoke(task) but it does not wit...
Pirandello asked 26/7, 2013 at 12:21
© 2022 - 2024 — McMap. All rights reserved.