Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
271 views

FutureTask get() method may distable LockSupport.park

i found FutureTask get() method may distable LockSupport.park in oracle jdk8 my code is : ExecutorService service = Executors.newFixedThreadPool(1, (r) -> { Thread thread = new ...
liuchiself's user avatar
-1 votes
1 answer
852 views

Spring re-try withing future tasks not working

I have a spring-boot application which which needs to call external APIs. If there are 'n' external calls, 'n' future tasks will be created and rest calls will be made. Problem here is if any of the ...
Brycil Noronha's user avatar
0 votes
0 answers
322 views

How to handle multiple return types using Future and executer's invokeAll in Java8?

How to handle multiple return types in future.get when invokeall is called? List<Future<List<Object>>> futureListe = executor.invokeAll(Classableobjekts); //Objekts list contain two ...
fatherazrael's user avatar
  • 5,927
0 votes
1 answer
397 views

When using an ExecutorService, is it possible for a Thread to become uninterruptible when in the WAITING state

I'm running into an issue where it seems as if a Thread has become uninterruptible while in a WAITING state. The task thread itself (as you'll see in the stack of the thread below) is waiting for a ...
Mike's user avatar
  • 33
0 votes
4 answers
5k views

Java Waiting for all threads to complete

Edit: My question is different, it has no relevance to the linked question. I've following code with completion handler. FutureTask<Void> futureTask = new FutureTask<Void>(() -> { ...
user2727195's user avatar
  • 7,320
-3 votes
1 answer
414 views

Java: Adding Future<obj> to a list

Now that I have a handle on retrieving objects in parallel, how can I add those objects to a list? I have a list of Future<Site> objects that I'm attempting to add to an ArrayList of Site ...
TheFunk's user avatar
  • 1,068
59 votes
2 answers
71k views

CompletableFuture, supplyAsync() and thenApply()

Need to confirm something. The following code: CompletableFuture .supplyAsync(() -> {return doSomethingAndReturnA();}) .thenApply(a -> convertToB(a)); would be the same as: ...
igr's user avatar
  • 10.6k