-
Notifications
You must be signed in to change notification settings - Fork 32
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
Redirecting stdout/stderr blocks a thread pool thread for each call #94
Comments
@drauch interesting; thanks for letting me know. It sounds like there is some discussion around the framework using named rather than anonymous pipes which presumably would fix it. Until then/if no action is taken, would you find it valuable if MedallionShell were to specify |
Thank you for the offer, it would be great, but we unfortunately can't use MedallionShell for more than this single reason. We use a custom made solution also because of:
Best regards, |
Thanks @drauch . If you don't mind, I'd love to understand a bit more about your asks in case I want to add anything to the library to cover these cases.
Can you explain a bit more what you mean by "separation, but also interleaved"? Out of the box, with MedallionShell you can get interleaved stdout/stderr like so:
If you want to consume the streams separately, you can also do that via
We only throw
The reason MedallionShell doesn't use the handler model is that that model gives you no easy wait for all handling to have finished, creating thread safety issues. If you want to handle lines of output as they arrive, with MedallionShell you'd do this:
.NET Core made the async handler waiting issue better because |
Yeah, we could also simply catch the TimeoutException and return a corresponding boolean, it'd be a minor change.
We need both at the same time, an interleaved version AND a separate version for the same call, that's why we couldn't use MedallionShell previously. |
How were you doing this with
|
Yep, that's probably the way to go + adding TaskCreationOptions.LongRunning so we don't block thread pool threads :-) |
FYI: I've tested dotnet/runtime#81896 with your library and unfortunately you're also affected.
Best regards,
D.R.
The text was updated successfully, but these errors were encountered: