You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this experiment we discovered that Java's CompletableFuture.get() blocks then suspends the thread it's on. Apparently when .complete() on that CompletableFuture is supposed to wake the suspended thread, but it's not working consistently (sometimes wakes within 2ms like it should, sometimes not till after 200ms).
For MVP we're moving forward with the busy wait, but if there's a more efficient technique that actually works, we should really use it.
The test for this is the assert traitObj.completedDelays == completedDelaysBefore in TestFixtureFutures. For anything to be considered working that should pass at least 100 times. Use CI tests if possible, they're much more consistent than reproducing locally.
The text was updated successfully, but these errors were encountered:
One thought for this is using CountdownLatch instead of CompletableFuture for the callback from Rust in the callback map. May have the same issue of waking that CFs do though, needs testing.
In this experiment we discovered that Java's
CompletableFuture
.get()
blocks then suspends the thread it's on. Apparently when.complete()
on thatCompletableFuture
is supposed to wake the suspended thread, but it's not working consistently (sometimes wakes within 2ms like it should, sometimes not till after 200ms).For MVP we're moving forward with the busy wait, but if there's a more efficient technique that actually works, we should really use it.
The test for this is the
assert traitObj.completedDelays == completedDelaysBefore
inTestFixtureFutures
. For anything to be considered working that should pass at least 100 times. Use CI tests if possible, they're much more consistent than reproducing locally.The text was updated successfully, but these errors were encountered: