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

Dynamic measurement thread issue #56

Open
jpcima opened this issue Jul 1, 2019 · 0 comments
Open

Dynamic measurement thread issue #56

jpcima opened this issue Jul 1, 2019 · 0 comments

Comments

@jpcima
Copy link
Owner

jpcima commented Jul 1, 2019

The InitTables method of Dosbox to initialize global data has a defect when using the emulator on multiple threads.

Description of the problem:

  • have 2 threads doing Init() each around the same time
  • T1 has entered InitTables(), has set doneTables = true
  • T2 takes over, InitTables() skips because of doneTables flag
  • T2 generates bad audio because tables are not filled

Also, there must be a synchronization to ensure correct sequencing of read and write.
Mutex will be fine.

(EDIT I don't use several threads in the worker for measuring so it's not affected; but needed for libADLMIDI's genadldata and I'll copy the changes here)

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

No branches or pull requests

1 participant