refactor: from guest threads to EE scheduler - #184
Conversation
|
Spent some time comparing this head-on with my #137, since they're really two takes on the same thing. Both kill the per-guest-thread host threads and put everything on one executor, we just picked different suspension mechanisms (I park fibers, you unwind with EeDispatcherTransfer and re-dispatch by PC). They can't merge together, so I benchmarked and probed both to figure out which one deserves to live. Short version: I think yours does. Reasoning below so you can check my work. Why I prefer this over #137:
The one thing I had to check first: fibers can block in the middle of an HLE helper and keep the live C++ frame; your model structurally can't (the throw destroys the frame). I wrote a small probe test against this branch to see how much that matters, and it turns out your answer is already in here: waitExternal's completion carries host state by value across the block, and the only in-tree helper that actually blocks mid-computation with live state (the MPEG picture pacing) is already written in that shape. So it's an authoring pattern future HLE code has to follow, not a missing capability. Happy to PR the probe test into this branch if you want it; it documents the resume semantics as tests (helper body runs twice, tail never runs, completion carries the value). What I'd like to bring over from #137 before I close it:
|
No description provided.