-
Notifications
You must be signed in to change notification settings - Fork 31
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
Threading problem, locks other instance files #90
Comments
I have found that this problem exists when UseShellExecute is set to False. |
Hi @tomasr78 it's going to be hard to figure out more without more information. For example:
This seems unlikely to be a MedallionShell issue because in the code shown MedallionShell doesn't touch the file at all; it just passes the name of the file as a command line argument. |
Sorry for the confusion, the problem is related to Magick.NET library which uses CreateProcess under the hood to run ImageMagick. It seems their CreateProcess interacts with other CraeteProcess methods and produce file lock problems. |
@tomasr78 thanks for the update. Do you think this issue can be closed? |
The issue is related to handles inheritance if you are not yet familiar with the problem you can read more at dotnet/runtime#13943 Do you have any plans to improve your library to fix the issue? |
@tomasr78 I've had #54 filed for some time. The problem is that AFAIK there's not really any way to do that without abandoning the Thus far, I've been waiting for .NET to offer a solution which MedallionShell can then adopt. |
I have found a lock file issue with MedallionShell when it is running several threads.
For example, I run two command-line applications (
App1
,App2
) using the code below and pass two different files for each app (App1 -> File1
,App2 -> File2
)Sometimes, the
App1 -> File1
finish processing the file, but for an unknown reason, File1 is locked by the App2 app.It is not possible to read the File1 file until App2 exits, through File1 was executed with App1 app in the first Command.Run instance.
Any idea what is going on? Is the code below thread-safe?
The text was updated successfully, but these errors were encountered: