Name: _____________________________ 6 Digit StudentID: ___ ___ ___ ___ ___ ___

Worksheet 26: Crossword and Executor Service

DOWN
1 What flags do in the wind
2 The Hawkeye State
3 It's half the faun
4 End of a philosophers utencil
5 Pie ___ mode
6 Tranquilize
7 ___ Strauss jeans
8 Millennium Falcon pilot
9 Co. name completer
10 Adversary
11 ____-N-Out Burger
16 "We hold ___ truths..."
17 It may be framed
21 Sassy
23 Cream puff
24 Mideast bigwig
25 It may be reentrant
26 Cathedral recess
27 Lose, as skin
28 Put up, as a picture
30 Alliance since '49
33 How to give a reprimand
35 ____ eleven: how a soccer team is forced to proceed after a red card
38 "Carmen" and "Norma"
41 Anatomical pouch
43 Artisan alliance
45 Start of a philosophers utencil
47 Former Winter Palace resident: Var.
48 Disavow
49 "What are the ___...?"
50 Compare and ____
51 Thumbs-up vote
52 Frequently, in poetry
53 Inclustion after the sig.
ACROSS
1 Newton ingredients?
5 Digital communication?: Abbr.
8 Platter player
12 Ransack
13 Author Harper
14 Briefly unknown?
15 Arrive and ____
18 Quilt square
19 They're sometimes put on
20 Didn't part with
22 Sauna attire
26 Volcanic fallout
29 Spotted
31 Car with a bar
32 This class gives a shout out to Vijay Saraswat and Vivek Sarkar
34 "Get then put is not _____"
36 Shipped
37 Canvas bag
39 LASEK alternative: photorefractive keratectomy
40 Noses (out)
42 Pioneering 70's video game
44 Condition preceder?
46 Perform better than
50 Implicit 25-Down keyword
53 Rind
54 Big galoot
55 Hit the runway
56 "Don't move!"
57 L.A. clock setting
58 Teetotalers

Interface Future<V>

V get()
Waits if necessary for the computation to complete, and then retrieves its result.

Interface ExecutorService

<T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks)
Executes the given tasks, returning a list of Futures holding their status and results when all complete. Future.isDone() is true for each element of the returned list. 
<T> Future<T> submit(Callable<T> task)
Submits a value-returning task for execution and returns a Future representing the pending results of the task. The Future's get method will return the task's result upon successful completion.

If you would like to immediately block waiting for a task, you can use constructions of the form result = exec.submit(aCallable).get();

Using executor.submit(task) and future.get(), write pseudocode for doItYourselfInvokeAll() which meets the spec of invokeAll():

<T> List<Future<T>> doItYourselfInvokeAll(ExecutorService executor, Collection<? extends Callable<T>> tasks) {











Post Lecture

Synthesize today's class session

 

 

What is unclear?