To use multiple processes or threads?

B

Brett

What are the advantages/disadvantages of using one process with multiple
threads or doing the same task with multiple processes, each having one
thread?

I see using multiple threads under one process as being a problem.
Potentially, one thread may crash and could bring down the whole process,
including all the other threads.

Using one process per thread seems more independent. This is similar to
what happens when you open multiple Notepads.

Thanks,
Brett
 
R

rawCoder

Isnt spawning multiple processes under one appdomain is more costly than
spawning threads under a process ?

HTH
rawCoder
 
S

Stephany Young

What you say is valid and you are able to do it that way if you so wish.

Prior to releasing your program, you will have, of course, taken all
reasonable steps to ensure that a given thread does not crash to the extent
that it brings the whole application down. But hey - shit happens - give it
a hose down and you're back in business.

I would argue that managing the flow of data between threads in a carefully
designed multi-threaded application is far easier and efficient than
managing the flow of data between seperate instances of an application.

The important thing to note is that it is critical to select and use the
appropriate methodology to meet your needs:

- if it is multi-threaded then make it multi-threaded

- if it is mulit-instanced then make it multi-instanced

It's up to you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top