Registry Mirror
Skip to content

Add feature to block DF multithreading #6049

Backlog

Description

@ab9rf

While investigating DF's use of threaded worker functions, in order to improve our guidance on what is safe to do in an interpose, I discovered fairly convincing evidence that DF's use of multithreading for line of sight processing contains a dangerous race condition that can corrupt data or crash the game.

Bay12 added a "feature" recently that forces multithreading on if the game's frame rate drops "too low". While this feature only triggers once per launch, we can't prevent it from triggering without a binpatch (its control variable is not where we can easily recover it without manual RE) so our remaining option is to add a tool that forcibly sets the "enable multithreading" flag to off every frame.

Given that this needs to run every frame to be effective, I propose doing this in the core loop itself instead of as a script or plugin, to minimize the performance impact this imposes.

Activity

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