Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multithreading #36

Open
eventhorizon5 opened this issue May 23, 2023 · 1 comment
Open

Multithreading #36

eventhorizon5 opened this issue May 23, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@eventhorizon5
Copy link
Owner

Due to a fix to the Console::Write function (I added a mutex lock around the function for thread safety), I've enabled WorkQueue multithreading in Ogre, which requires a rebuild of Ogre. If you still haven't yet, rebuild Ogre with OGRE_CONFIG_THREADS=3 which is the default.

Previously wxWidgets would crash in the Console code due to multiple Ogre threads trying to call the Write function simultaneously, but due to the mutex fix, it now works properly since the threads are now synchronized.

Since Ogre will support multithreaded workqueues with that, I'll see if I can utilize them to multithread portions of Skyscraper. I've also wanted to run each sim engine in a thread, but am not yet sure how to do that safely (so far I know that some code such as the render buffer code needs to be only called from the primary thread).

@eventhorizon5 eventhorizon5 added the enhancement New feature or request label May 23, 2023
@eventhorizon5 eventhorizon5 self-assigned this May 23, 2023
@eventhorizon5
Copy link
Owner Author

Current multithreading work (4th attempt so far) is in the 'threading2' branch. This code is aiming for inclusion in the 2.1 codebase, if it can become working and stabilize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant