0

I need to do a lot of work in UI thread. This work consumes a lot of CPU and memory resources. In current realization I use Dispatcher.BeginInvoke() method, but it makes my application frozen.

What if I will delegate this job to child process without GUI? Main process run child process. After that main application sends some commands to child process, child process do some job and returns result object to host process?

How to communicate between host and child processes? I know about .NET remoting (marshaling), but it obsolete method (or not?).

Thanks and sorry for my bad english.

Dmitriy
  • 654
  • 10
  • 24
  • Have you looked at a backgroundworker as solution? – Jordy Jun 06 '13 at 11:13
  • ofcourse. the problem is that i need do a lot of work in GUI thread. it can't be done in background thread – Dmitriy Jun 06 '13 at 11:17
  • what kind of work are we talking about here? And why should it take place in the GUI thread? – Jordy Jun 06 '13 at 12:52
  • Use a thread, a process just gives you two problems. [This answer](http://stackoverflow.com/questions/4269800/webbrowser-control-in-a-new-thread) shows how. – Hans Passant Jun 06 '13 at 13:44

1 Answers1

0

I've made a child process management library where the parent process and the child process are monitored due a bidirectional WCF pipe. If either the child process terminates or the parent process terminates each other is notified. There is also a debugger helper available which automatically attaches the VS debugger to the started child process

You have a extendable communication infrastructure between the processes. No need for WCF knowledge.

Project site:

http://www.crawler-lib.net/child-processes

NuGet Packages:

https://www.nuget.org/packages/ChildProcesses https://www.nuget.org/packages/ChildProcesses.VisualStudioDebug/

Thomas Maierhofer
  • 2,665
  • 18
  • 33