Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

resetCycles should be (more) immediate #1197

@yaxu

Description

@yaxu

resetCycles resets the start time (to 'now') and tick count (to 0), so could in theory happen at now+latency time, regardless of the value of cFrameTimespan.

However if cFrameTimespan is set to e.g. 1, there is an unpredictable delay of between 0 and 1 seconds on top of latency. This seems to because the thread is delayed in the tick function, and so no input is processed between frames.

Instead of using threadDelay, it seems it's possible to do timeouts with STM. So tidal could wait for an action to process until the end of the frame.

I've not done any work with STM before and it looks like this would need an adjustment to how the queue is done currently? In the current implementation the TVar always contains a value so there's nothing to 'wait' for (without continuously polling for something other than a NoAction).

Does that sound like a reasonable analysis @Zalastax ?

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