Skip to content

Improve callback interface performance (busy waiting) #29

@skeet70

Description

@skeet70

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions