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

FEXCore: Move InternalThreadState StartRunning to frontend #4182

Merged
merged 2 commits into from
Nov 29, 2024

Conversation

Sonicadvance1
Copy link
Member

@Sonicadvance1 Sonicadvance1 commented Nov 29, 2024

We were using this variable for two things, letting the frontend signal
to the backend that it wants to start executing once the thread is
created, and also for handling thread pausing. These two features are
conflated with one another and actually makes things more confusing.

  • Move StartRunning/StartPaused to the frontend, because its a construct
    that only needs to exist in the frontend
  • Adds a FEX::HLE::ThreadStateObject CV for handling pausing, which only
    needs to exist for gdbserver

@Sonicadvance1 Sonicadvance1 force-pushed the move_start_paused branch 2 times, most recently from 76042f1 to 58bfeb4 Compare November 29, 2024 06:11
We were using this variable for two things, letting the frontend signal
to the backend that it wants to start executing once the thread is
created, and also for handling thread pausing. These two features are
conflated with one another and actually makes things more confusing.

- Move StartRunning/StartPaused to the frontend, because its a construct
  that only needs to exist in the frontend
- Adds a FEX::HLE::ThreadStateObject CV for handling pausing, which only
  needs to exist for gdbserver
Now that most of the thread tracking is in the frontend, change this
over to building the thread execution handler on the parent thread.

Removes a memory allocation/free pair, and removes the copy of each
variable in the child thread.
Sonicadvance1 added a commit to Sonicadvance1/FEX that referenced this pull request Nov 29, 2024
Relies on FEX-Emu#4182 and FEX-Emu#4183 getting merged first, which is the first three
commits.

These are all frontend constructs with mostly deprecated constraints.
WaitingToStart isn't used anymore, Running is effectively always true
(and behaviour has changed that if a thread is alive, it's running).

The only one that remains is `ThreadSleeping` which is only handled in
the frontend, and there was some conflation between ThreadSleeping and
Running which was hard to gauge. So delete `Running` and
`WaitingToStart`, but move `ThreadSleeping` to the frontend.
@lioncash lioncash merged commit e89f48f into FEX-Emu:main Nov 29, 2024
12 checks passed
@Sonicadvance1 Sonicadvance1 deleted the move_start_paused branch November 29, 2024 21:31
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

Successfully merging this pull request may close these issues.

2 participants