-
Notifications
You must be signed in to change notification settings - Fork 66
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
Async JIT execution leads to crashes #840
Comments
sub_320880(
&dword_76F380,
"sv_parallel_send",
"0",
0x80000,
"Pack and send snapshots in parallel for smoother server tick rate at the expense of spending more CPU.",
sub_1AF5F0);
|
Also I remember that |
Example crash detailsStack trace
Frame context
|
There is no thread safety model for SourcePawn data structures, and it'd be very difficult to define and implement one efficiently. And I'm opposed to a global interpreter lock, which defeats the point of threading. So really the only path forward is an isolation model, where separate threads do not share any resources except those that can be sent over pipes. Think something like Web Workers. Even if we build that out, SourceMod is completely thread unsafe. Every single native would have to be audited, and the set of natives available would have to be restricted off the main thread. Otherwise it'd be a free-for-all and we'd get bug reports every day about how random thing X crashes 10% of the time. tl;dr: a "proper" solution is not coming anytime soon. Instead, I think spot-fixes are needed for safety here. Anywhere a SourceHook callback could be called off the main thread, we should check and bypass interactions with main-thread plugins (and use mutexes if main thread data structures are at risk). Your solution of using an extension or MM:S plugin is the right way, IMO. |
Another case with asynchronous Stack trace
|
Reporting stacks is not helping anything. We've always known SP doesn't support running concurrently. |
This is an sdkhooks bug not SP. |
Hello,
I would like to see support in SourcePawn for executing JIT OP-Code in several threads at the same time.
For example, when using
sv_parallel_send <numthreads>
that executesSetTransmit
in different threads (and in SourceMod), server does crashesI also need my upcoming PR to SourceMod with
async
(to make huge hierarchical miscalculations with the Navigation Meshes of the map without loading the main game thread (tick delays in milliseconds/aka server var) :P)
The text was updated successfully, but these errors were encountered: