Looking for Programación concurrente y avanzada test answers and solutions? Browse our comprehensive collection of verified answers for Programación concurrente y avanzada at moodle.upm.es.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
Seleccione la respuesta incorrecta referida a la sincronía de los canales de comunicación:
Seleccione la respuesta incorrecta referida al direccionamiento en la comunicación por mensajes:
Seleccione la respuesta incorrecta referida a mensajes:
Channel of integer ch | |
producer | consumer |
integer x ← 0 p1: while x < 2 p2: ch <= x p3: print(“a”) p4: x ← x + 1 | integer y ← 0 q1: while y < 2 q2: ch => y q3: print(“b”) |
El siguiente código es erróneo ya que (seleccione la opción correcta):CompletableFuture<?> prevCS = new CompletableFuture<>();prevCS.supplyAsync(() -> { List<Integer> list = List.of(1,2,3,4,5); for(Integer element:list){ System.out.println(Math.pow(element,2));}});
Seleccione la respuesta correcta: Para asegurar que una nueva tarea se empezará a ejecutar cuando 12 tareas previas hayan terminado...
Teniendo el siguiente código incluido en una función main, al ejecutarlo resultará (seleccione la respuesta correcta):CompletableFuture<List<Integer>> prevCS = new CompletableFuture<>(); prevCS.supplyAsync(() -> { List<Integer> list = List.of(1,2,3,4,5); List<Integer> squared = new ArrayList<>(); for(Integer element:list){ squared.add((int) Math.pow(element,2));} return squared; }) .thenAccept(()->{ System.out.println(squared); });
Seleccione la respuesta correcta acerca de recoger resultados cuando una etapa se completa.