Skip to content

Dynamic running sometimes doesn't update when UI inputs change #3

Description

@Steell

Happens often w/ sliders, less often with text boxes.

I think what's happening is a race condition between the UI thread and the evaluation thread. Evaluate thread fetches UI value, UI thread then updates the value, and then evaluate thread marks it as clean after using the old value.

Solution: wrap evaluate thread in UI dispatcher such that UI is fetched and marked clean in the UI thread. This way, the UI updates before the evaluation (and the latest value is fetched) or the old value is fetched and the node is marked clean before the change happens and it becomes dirty again (the queue will then rerun it to get the changes).

Activity

  1. ghost assigned on Jun 12, 2012
  2. Steell commented on Jun 12, 2012

    @Steell
    ContributorAuthor

    Other potential solution: setting IsDirty to true kills current execution and the re-evals.

    Pros: potentially faster, less likely to get garbage data, can rollback the transaction so document will never get updated.
    Cons: could result in unexpected run issues and element states which are unaccounted for. With DMU might not be a problem, but still potential unexpected thread issues may arise.

  3. Steell commented on Jun 12, 2012

    @Steell
    ContributorAuthor

    IsInteractive attribute can now come into use. If true, eval is wrapped in dispatcher. Entire eval needs to be wrapped (from checking if cancelled to setting IsDirty to false) in order to avoid race conditions. Once the eval cancellation flag is set, IsDirty can NOT be set to false before the evaluation actually stops.

  4. added a commit that references this issue on Dec 15, 2014
  5. added a commit that references this issue on Jun 23, 2015
  6. added a commit that references this issue on Jan 11, 2019
  7. added a commit that references this issue on Jul 30, 2021
  8. added a commit that references this issue on Aug 18, 2021
  9. added a commit that references this issue on Oct 26, 2021
  10. added a commit that references this issue on May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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