Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exe Runs Slow on Web Site

Status
Not open for further replies.

Meleagant

Programmer
Aug 31, 2001
166
US
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:
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top