-
-
Notifications
You must be signed in to change notification settings - Fork 297
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
multithreaded job processing #1311
Conversation
Currently giving this a try while starting work on peer type resolution in zls; issues I'm having so far:
|
1b79be4
to
e3fe043
Compare
Ditto to VS Code printing "[Error] Stopping server timed out" even though it seems to just keep going and works fine. Seems to be some weirdness with go to in hover, hovering over const E = error{ X, Y };
const S = struct { alpha: u32 };
fn errorable() E!S {
return undefined;
} |
I overlooked a change while resolving merge conflicts. This should be resolved now |
I've also encountered this issue and though this was a configuration issue. Is is it possible that you are using VSCode and have set
I suspect that I am not responding to some request. I will need to do some more investigating. |
Nope, it's set to |
Sometimes zls stops responding and the server has to be restarted. Attaching a debugger shows multiple threads sitting here: zls/src/features/diagnostics.zig Line 232 in 1c749e4
After locking up and restarting zls five times:
|
The issue occurs when multiple zig child processes are spawned to do ast check at the same time. I've confirmed that adding a mutex to |
481c164
to
996c0f2
Compare
Can't recreate the lockup any more 👍. I will keep trying to break it but so far this is looking good, also I will hold off on merging other PRs for a while to prevent so many conflicts building up here. |
b33a002
to
42090c1
Compare
I haven't been able to break this after ~12 hours of use, so I think its time to merge it and wait for the screams :) |
Independent requests, diagnostics and build file loading will now be processed in parallel. This means faster message handling as well as near instant startup time
and more race conditions.I would appreciate if anyone who reads this would try out this PR to see if there are any issues that need to be addressed.
Also, should multithreading be enabled by default? I already made sure that ZLS can still be build as a single threaded executable.
I've also redesigned the public API of Server that plays nice with zls-as-lib-demo.
Future Improvements:
Tracy is starting to look interesting