Commit 2f50bd8
authored
Remove excessive mutex synchronization (#3637)
Remove excessive mutex synchronization (#3637)
### Motivation
With the improvements to the position scanners (#3612 and #3583), we're now seeing some cases of invalid location being raised, despite no reports of any issues regarding the state of the documents.
I think we're making a mistake by trying to apply document operations with higher priority than feature requests. For example, if we receive a request for completion and the user immediately edits the file, the server might process the edit before finishing the completion request and there are no guarantees that the new state of the document can satisfy that original request.
I want to propose pushing text synchronization operations to the queue, so that they are processed in order and without locking, which I believe will improve the situation.
### Implementation
I start pushing text synchronization operations to the work queue and removed many of the mutex locks that we originally had.
Since requests are processed in order, there should not be a chance of a feature request being processed with an incorrect document state.
Co-authored-by: vinistock <[email protected]>1 parent 505f469 commit 2f50bd8
3 files changed
+40
-53
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | | - | |
| 86 | + | |
88 | 87 | | |
89 | 88 | | |
90 | 89 | | |
| |||
94 | 93 | | |
95 | 94 | | |
96 | 95 | | |
97 | | - | |
| 96 | + | |
98 | 97 | | |
99 | 98 | | |
100 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
148 | 146 | | |
149 | 147 | | |
150 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
380 | 379 | | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
387 | 386 | | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
393 | 392 | | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
401 | 399 | | |
402 | | - | |
403 | | - | |
| 400 | + | |
| 401 | + | |
404 | 402 | | |
405 | 403 | | |
406 | 404 | | |
407 | 405 | | |
408 | 406 | | |
409 | | - | |
410 | | - | |
411 | | - | |
| 407 | + | |
| 408 | + | |
412 | 409 | | |
413 | | - | |
414 | | - | |
415 | | - | |
| 410 | + | |
| 411 | + | |
416 | 412 | | |
417 | 413 | | |
418 | 414 | | |
419 | 415 | | |
420 | 416 | | |
421 | 417 | | |
422 | 418 | | |
423 | | - | |
424 | | - | |
425 | | - | |
| 419 | + | |
426 | 420 | | |
427 | 421 | | |
428 | 422 | | |
| |||
1105 | 1099 | | |
1106 | 1100 | | |
1107 | 1101 | | |
1108 | | - | |
1109 | | - | |
1110 | | - | |
1111 | | - | |
1112 | | - | |
| 1102 | + | |
1113 | 1103 | | |
1114 | 1104 | | |
1115 | 1105 | | |
| |||
0 commit comments