What's the cost of blocking on asynchronous methods?

时间:2018-05-06 17:12:06

标签: java asynchronous rx-java completable-future

What is the cost (in terms of memory, performance, etc) of having threads block on the result of async operations (e.g. >>> changeable_list.append(44) >>> changeable_list [22, 44] >>> di {(22,): [22, 44]} or index(Str:D $: Cool:D $needle, *%_) index(Str:D $: Str:D $needle, *%_) index(Str:D $: Cool:D $needle, Cool:D $pos, *%_) index(Str:D $: Str:D $needle, Int:D $pos, *%_) ) versus propagating asynchronous promises to the caller of the method?

Why Am I asking this Question

3 months ago I drank the cool-aid and went all-asynchronous using CompletableFuture. I've since come across the following complications:

Without commenting on the severity of the above problems, let's just agree that async code is more complicated than it's sync counterpart.

I'm hoping that it is possible to limit the usage of async code to portions that benefit from it, while keeping the rest of the code synchronous.

0 个答案:

没有答案