Forums Register Login

A good way to get a value that is computed asynchronously

+Pie Number of slices to send: Send
Hi!
I am working on a Vulkan renderer. And in order to improve loading time when I startup the program I use CompletableFuture to asynchronously compute some data that is not needed immediately. Now speed of access to this data is important.
So I'm unsure how I would achieve safely getting this data and waiting in case of the CompletableFuture not being done executing.
This is the solution I thought of but it's dirty to say the least. Would anyone have idea how this could be done in a cleaner/faster way?

I child proofed my house but they still get in. Distract them with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 374 times.
Similar Threads
Need Help with Multithreading a MVC Application
program to calculate area of hexagon based on size (input)
AngularJs as the alternative choice for building web interface
How does client poll the interaction layer to get the result of WS invocation?
Architectural Evolution with Entity Beans
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 19:19:02.