[Mlir-commits] [mlir] b31827f - [mlir-lsp-server] Disable multi-threading in LSP contexts

River Riddle llvmlistbot at llvm.org
Tue Aug 3 14:35:30 PDT 2021


Author: River Riddle
Date: 2021-08-03T21:30:09Z
New Revision: b31827f6641178905a866682c0d868b1ca436a5e

URL: https://github.com/llvm/llvm-project/commit/b31827f6641178905a866682c0d868b1ca436a5e
DIFF: https://github.com/llvm/llvm-project/commit/b31827f6641178905a866682c0d868b1ca436a5e.diff

LOG: [mlir-lsp-server] Disable multi-threading in LSP contexts

This prevents an explosion of threads, given that each file gets its own context and thus its own thread pool. We don't really need a thread pool for the LSP contexts anyways, so it's better to just disable threading.

Added: 
    

Modified: 
    mlir/lib/Tools/mlir-lsp-server/MLIRServer.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Tools/mlir-lsp-server/MLIRServer.cpp b/mlir/lib/Tools/mlir-lsp-server/MLIRServer.cpp
index ae60d76f27e1..35ada85a37d1 100644
--- a/mlir/lib/Tools/mlir-lsp-server/MLIRServer.cpp
+++ b/mlir/lib/Tools/mlir-lsp-server/MLIRServer.cpp
@@ -328,7 +328,7 @@ struct MLIRDocument {
 MLIRDocument::MLIRDocument(const lsp::URIForFile &uri, StringRef contents,
                            DialectRegistry &registry,
                            std::vector<lsp::Diagnostic> &diagnostics)
-    : context(registry) {
+    : context(registry, MLIRContext::Threading::DISABLED) {
   context.allowUnregisteredDialects();
   ScopedDiagnosticHandler handler(&context, [&](Diagnostic &diag) {
     diagnostics.push_back(getLspDiagnoticFromDiag(sourceMgr, diag, uri));


        


More information about the Mlir-commits mailing list