Multi-processing
-
In .Net, we know multithreading, but is it possible to do multi-processing, if I really need, like in C/C++ env? Or multi-appdomain is the alternative in .Net? Thanks, :laugh:
Not sure what you mean, here. Your use of the word "multi-processing" is ambiguous. True multi-processing requires more than one processing unit. With kernel-level threads, which .NET has, you can have multiple threads run on multiple processors. If you're asking can .NET spawn new processes (like fork()), then, yes, it can do that, too. Finally, AppDomains offer a lighter-weight, dedicated memory in-process process. Does that answer your question?
"we must lose precision to make significant statements about complex systems." -deKorvin on uncertainty
-
Not sure what you mean, here. Your use of the word "multi-processing" is ambiguous. True multi-processing requires more than one processing unit. With kernel-level threads, which .NET has, you can have multiple threads run on multiple processors. If you're asking can .NET spawn new processes (like fork()), then, yes, it can do that, too. Finally, AppDomains offer a lighter-weight, dedicated memory in-process process. Does that answer your question?
"we must lose precision to make significant statements about complex systems." -deKorvin on uncertainty
Thanks. Basically, just same as you said like fork() in Unix, the new created process will run in its own process container and truly isolated from the parent process, so failure in this process won't bring down others. whether it's supported in the kernel mode or the user mode, is not the concern yet. As you said, "it can do that", can you direct me to some info of how to do it? Thanks.
-
Thanks. Basically, just same as you said like fork() in Unix, the new created process will run in its own process container and truly isolated from the parent process, so failure in this process won't bring down others. whether it's supported in the kernel mode or the user mode, is not the concern yet. As you said, "it can do that", can you direct me to some info of how to do it? Thanks.
Just look up the
System.Diagnostics.Process
class.A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Thanks. Basically, just same as you said like fork() in Unix, the new created process will run in its own process container and truly isolated from the parent process, so failure in this process won't bring down others. whether it's supported in the kernel mode or the user mode, is not the concern yet. As you said, "it can do that", can you direct me to some info of how to do it? Thanks.
-
Thanks you and Dave Kreskowiak, but looks like that this System.Diagnostics.Process class just provides access to local and remote processes and enables you to start and stop local system processes, not let us create a new process and let us run our code in it. Or I might get something wrong, could you give me a small example?
-
Thanks you and Dave Kreskowiak, but looks like that this System.Diagnostics.Process class just provides access to local and remote processes and enables you to start and stop local system processes, not let us create a new process and let us run our code in it. Or I might get something wrong, could you give me a small example?
If you're looking for the C# equivalent to
// in file foo.c
if(fork()) {
// Do parent process stuff here
} else {
// Do child process stuff here
}then I have to disappoint you by reporting that the .NET runtime supports no such system-like call. However, I would challenge the decision to do this by saying, "Hey, that's provedural code out the yin-yang and, since we're ostensibly using an object-oriented framework, then we should seek object-oriented solutions." Just my 0.02 USD.
"we must lose precision to make significant statements about complex systems." -deKorvin on uncertainty