473,467 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

To use multiple processes or threads?

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
Nov 21 '05 #1
2 2306
Isnt spawning multiple processes under one appdomain is more costly than
spawning threads under a process ?

HTH
rawCoder
"Brett" <no@spam.com> wrote in message
news:OR**************@TK2MSFTNGP09.phx.gbl...
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

Nov 21 '05 #2
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.
"Brett" <no@spam.com> wrote in message
news:OR**************@TK2MSFTNGP09.phx.gbl...
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

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tony Liu | last post by:
Hi, how can I create multiple new file handles of a file without having to share to file to the other processes? I have a file that will be accessed by multiple threads in my application, each...
2
by: Hollywood | last post by:
I have a system in which I have a single thread that places data on a Queue. Then I have one worker thread that waits until data is put on the thread and dequeues the Queue and processes that...
9
by: Abhishek Srivastava | last post by:
Hello All, In IIS 6.0 We have a concept of worker processes and application pools. As I understand it, we can have multiple worker process per appliction pool. Each worker process is dedicated...
2
by: Tumurbaatar S. | last post by:
ASP.NET QuickStart Tutorial says that: .... ASP.NET maintains a pool of HttpApplication instances over the course of a Web application's lifetime. ASP.NET automatically assigns one of these...
5
by: Jeremy | last post by:
I have a core VB service that monitors a database, and based on data in the records will execute code to send email notifications. Problem: I don't want my main program code to halt and wait for...
4
by: Gregory Gadow | last post by:
I've cobbled together a PrinterClass that takes a text file and dumps it to a printer. The app using is has multiple threads, all of which need access to a shared instance. Can someone point me to...
10
by: John | last post by:
I currently have a Windows Service that runs Transactions that are very Processor/Memory Intensive. I have a requirement to deploy multiple instances of the Web service on the Same server. Each...
4
by: tdahsu | last post by:
All, I'd appreciate any help. I've got a list of files in a directory, and I'd like to iterate through that list and process each one. Rather than do that serially, I was thinking I should...
6
by: Tim Arnold | last post by:
I have a bunch of processes to run and each one needs its own working directory. I'd also like to know when all of the processes are finished. (1) First thought was threads, until I saw that...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.