Difficults Flashcards

1
Q

ForkJoin

A

example of fibbonacci

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

RecursiveAction

A

Dont return anything, implements the compute method

it executes the compute method with solve()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

RecursiveTask

A

l

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

invokeall

A

fgd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

forkjoinpool

A

l

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

fork

A

yy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Always use the .compute() method in recursive task before the join method

A

make sure that fork() is called before the current thread begins a subtask and that join() is called after it finishes retrieving the results, in order for them to be done in parallel.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

notes

A

The invokeAll() method takes two instances of the fork/join class and does not return a result.

The fork() method causes a new task to be submitted to the pool and is similar to the thread executor submit() method.

The join() method is called after the fork() method and causes the current thread to wait for the results of a subtask.

Unlike fork(), calling compute() within a compute() method causes the task to wait for the results of the subtask.

The fork() method should be called before the current thread performs a compute() operation, with join() called to read the results afterward.

Since compute() takes no arguments, the constructor of the class is often used to pass instructions to the task.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Files.find(Path, int, BiPredicate)

A

Returns a Stream of paths that traverses the directory specified, to a max depth of the int specified, filtering the stream on the BiPredicate provided

public static Stream find(Path start, int maxDepth, BiPredicate matcher, FileVisitOption… options) throws IOException

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Files method

Files.walk(path)

A

Returns a Stream object that traverses the directory in a depth-first, lazy manner. Recorre todos los hijos del path y devuelve stream con estos

May throw IOException

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Files method

Files.list(Path)

A

Returns a Stream containing the contents of the directory specified, only to one level, so no traversing down the rest of the structure.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly