How to optimize an asp.net spawning a new process for each request ?
- by Recycle Bin
I have an asp.net mvc application that spawns a Process as follows:
Process p = new Process();
p.EnableRaisingEvents = true;
p.Exited += new EventHandler(p_Exited);
p.StartInfo.Arguments = "-interaction=nonstopmode " + inputpath;
p.StartInfo.WorkingDirectory = dir;
p.StartInfo.UseShellExecute = false;
p.StartInfo.FileName = "pdflatex.exe";
p.StartInfo.LoadUserProfile = true;
p.Start();
p.WaitForExit();
Before going further, I need to know whether, e.g., pdflatex.exe is a managed code or a native code?
Edit
I need to consider this because: (Hopely I am not wrong...)
Each Asp.net application runs in an separate/isolated AppDomain as opposed to a separate/isolated process.
A native executable cannot live in an AppDomain.
to be continued...
Shortly speaking, I hope my site does not spawn a new process for each request. Because a process is more expensive than an application domain.