Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

What is the main difference between thread and process?

Status
Not open for further replies.

sacrpio

Member level 3
Joined
May 24, 2004
Messages
56
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
500
thread & process

What is the main diffirence between a thread & a process. What we have to choose in our application.
 

Re: thread & process

process has its own memory space ... isolated and protected ... a single process can have multiple threads ... which are ... light weight processes ... ie processes without memory protection ...

simply put processes are one-up in the heirarchy over threads ...
an os can have multiple processes while a process can have multilpe threads ...

i hope ive resolved your query
 

thread & process

I recommend this book:
Programming Applications for Microsoft Windows
By Jeffrey Richter

I think almost all embeded os do not distinguish the concept between thread and process.
 

Re: thread & process

A process is normally associated with a single program. The program may be multi-threaded or single-threaded.
 

thread & process

process consist one or more threads

process is complete application , threads are functions inside process that run concurrently and independetly.

for example excel program is a process but inside it many threads.

when you build a program usualy consist one thread , if you want to add more threads you have to tell the compiler.
 

Re: thread & process

well simply a thread is the smallest unit of a process. like an atom is the smallest unit of matter.

so when we break a process into pieces, the smallest piece will be a thread.
 

Re: thread & process

Threads are independent each other, thus, canbe executed in parallel without little overhead. Therefore, server computers with multiple CPUs will increase the performance if the programs are run based on Threads.
For a usual PC with a single processor, the performance will be improved little although you use thread-based programs.
 

Re: thread & process

shamrani said:
...
process is complete application , threads are functions inside process that run concurrently and independetly.

well, I think not exactly. I consider this perhaps better expresses what a process is :
a process is the instance of a currently running application, or to put it strightly a process is a single image of the application that's currently executing in memory.

So, for example, AFAIK, windows explorer always executes as a single process, no matter how many times you invoke it, it'll just create another thread to serve the new "request". While perhaps most of our daily application, will execute a new process i.e. new "instance" of the application that's excuted in memory, independent of the "instance" of the first invocation. I think this is the purpose of hPrevInstance for in winAPI for 16 bit windows back then. I'm not so "literate" in the implementation of recognizing application instance. CMIIW
 

Re: thread & process

Hi,

Look, to put things easy:

1. A thread is within a process, this can be any type of division as I can see. People like to divide threads away from processes -> just like dividing things in stages. For this case, it will be 'stage a' in 'stage 1'. Sorry if the last part doesn't make sense

2. a process is a sub task which is there only to make programming for the programmer easier.

There are other explainations such as a process sharing the same cpu while a thread sharing the same stack etc. But I don't like those.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top