[DefApp] Move from Monarch multi instance servers to Peasant single instance servers#10823
[DefApp] Move from Monarch multi instance servers to Peasant single instance servers#1082310 commits merged intomainfrom
Conversation
…w the inbound connection onto the UI thread so it doesn't have a hissy fit.
…at makes things mad.
…tab failed to be created from defterm and can tell com that it shit the bed
…rformed on a UI thread
|
LOVE IT. IT MAKES SO MUCH SENSE |
|
@msftbot make sure @miniksa signs off on this |
|
Hello @zadjii-msft! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
zadjii-msft
left a comment
There was a problem hiding this comment.
Hokay so lemme get this straight:
- COM creates a
wt -embeddingprocess to try and host the incoming connection - that wt automatically tosses the commandline to the Monarch to have it deal with it.
- The monarch will then either
- Toss the commandline
wt -embeddingto the appropriate peasant, who then- starts the COM server
- accepts the connection
- stops the server
- opens the tab
- Or the monarch decides that this connection should be a new peasant (a new window)
- the new window opens
- starts the server, accepts the connection, ... opens the tab
all based on what we already had.
That's fricken amazing.
|
|
||
| _SummonWindowRequestedHandlers(*this, nullptr); | ||
|
|
||
| std::unique_lock<std::mutex> lock{ mtx }; |
There was a problem hiding this comment.
Something is up here and I'm not certain what it is.
It worries me that you covered one definition of lock (since the lambda captured everything) with another more local definition of the same thing.
The inside of this lambda isn't even using the lock. Is it? Am I missing an implicit piece of the construction here?
There was a problem hiding this comment.
I should probably change the name of the lock inside of the lambda, that's a good point.
As for whether the inside of the lambda is using the lock, we should technically be acquiring the lock before modifying finalVal since that's the shared resource right?
There was a problem hiding this comment.
I need an adult to answer that. I just copied this pattern from somewhere else. @lhecker halp.
There was a problem hiding this comment.
(This is where I stole the idea from:
)There was a problem hiding this comment.
You can use til::latch for this now. Less overhead & easier to use. 🙂
- You need to import it yourself as
<til/latch.h>(just like a stdlib header - no need to put it intopch.h) - Instantiate it as
til::latch latch(1); - Replace the mutex/condition_variable code inside the lambda with
lath.count_down() - Replace the mutex/condition_variable code outside the lambda with
latch.wait() - Just make sure to write the data before counting down and only read from it after wait() has returned.
|
Hello @zadjii-msft! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
…nstance servers (#10823) - Monarch no longer sets itself up as a `CTerminalHandoff` multi instance server by default - In fact, `CTerminalHandoff` will only ever be a single instance server - When COM needs a `CTerminalHandoff`, it launches `wt.exe -embedding`, which gets picked up by the Monarch and then gets handed off to itself/peasant depending on user settings. - Peasant now recognizes the `-embedding` commandline and will start a `CTerminalHandoff` single instance listener, and receives the connection into a new tab. Closes #10358
|
🎉 Handy links: |
|
🎉 Handy links: |
CTerminalHandoffmulti instance server by defaultCTerminalHandoffwill only ever be a single instance serverCTerminalHandoff, it launcheswt.exe -embedding, which gets picked up by the Monarch and then gets handed off to itself/peasant depending on user settings.-embeddingcommandline and will start aCTerminalHandoffsingle instance listener, and receives the connection into a new tab.Closes #10358, #9475