I want to use a C# program to start all these as separate processes using threads so that I can utilize all the CPU cores in my machine.
When i run these commands sequentially one by one, everything works fine.
But, when i use 4 threads, sometimes it works and sometimes one or two fails. The error Windows give me is “The root.exe has stopped working”.
Is this a known issue? Is there any other way to achieve the same utilization? Could you please let me know?
why do you need to use threads? Can’t you “just” spawn these programs, i.e. use whatever corresponds to CreateProcess() in C#?
I have no idea why root would fail for some of your cases; you will need to attach the debugger (VisualStudio) and let us know. It might help to wait a bit between spawning the root.exe sub-processes.
It uses, processes in C#. I mentioned threads, because each process is created by different threads of another runtime.
I wrote two simple programs, one in C# and one in Java to invoke root.exe concurrently.
In both of them, few root processes fail once in a while.
Then, I copied the entire root directory multiple times so that I have multiple root instances in my machine. I used the same programs to call different root.exes in different directories concurrently and it works fine.
So it seems, that some locking mechanism exists which use files in root.
I cannot use PROOF, because the application should work on a Windows cluster.