All,
I have to call an exe (C program written by another developer) from my web site. When run from a command prompt the exe flies, processes in half an hour. When run from the web site it is slow as all get out, processes in 5 hours).
WHY!?!?!?!
I don't think I am starting my new thread incorrectly or even calling the Process.Start incorrectly. But why does would the Exe run a hec of a lot slower when called through the web application?
The Request is initiated through a web service call:
The New Thread is started:
Then the exe is actually run here:
* Sine scientia ars nihil est
* Respondeat superior
I have to call an exe (C program written by another developer) from my web site. When run from a command prompt the exe flies, processes in half an hour. When run from the web site it is slow as all get out, processes in 5 hours).
WHY!?!?!?!
I don't think I am starting my new thread incorrectly or even calling the Process.Start incorrectly. But why does would the Exe run a hec of a lot slower when called through the web application?
The Request is initiated through a web service call:
Code:
<WebMethod()> Public Function RunCostAcctProcesses(ByVal param1 As String, ByVal param2 As String) As String
Dim clsProc As New RunProcesses(param1, param2)
Dim newThread As Thread = New Thread(New ParameterizedThreadStart(AddressOf RunCostProcesses))
newThread.Start(clsProc)
Return String.Empty
End Function
The New Thread is started:
Code:
Private Sub RunCostProcesses(ByVal obj As Object)
'RunProcesses is my class where I can call all of my different exes.
Dim clsTest As RunProcesses = CType(obj, RunProcesses)
clsTest.Start()
End Sub
Then the exe is actually run here:
Code:
Private Sub RunPhase1()
Dim psi As System.Diagnostics.ProcessStartInfo
Dim processPath As String
processPath = "C:\Inetpub\[URL unfurl="true"]wwwroot\Dev\Utilities\Process1.exe"[/URL]
psi = New System.Diagnostics.ProcessStartInfo(processPath)
psi.UseShellExecute = True
Dim arguments As New StringBuilder
arguments.AppendFormat(" {0} {1}", Me.Param1, Me.Param2)
psi.Arguments = arguments.ToString
Dim proc As New System.Diagnostics.Process
proc = System.Diagnostics.Process.Start(psi)
proc.WaitForExit()
End Sub
* Sine scientia ars nihil est
* Respondeat superior