| Author |
Message |
sacrpio
Joined: 24 May 2004 Posts: 56
|
13 Jul 2004 6:26 thread & process |
|
|
|
| What is the main diffirence between a thread & a process. What we have to choose in our application.
|
|
| Back to top |
|
 |
alirizwan
Joined: 12 Jul 2004 Posts: 1
|
13 Jul 2004 7:50 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
|
|
| Back to top |
|
 |
liub
Joined: 21 Apr 2003 Posts: 5
|
10 Aug 2004 15:26 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.
|
|
| Back to top |
|
 |
checkmate
Joined: 25 Feb 2004 Posts: 489 Helped: 35 Location: Toilet Seat
|
10 Aug 2004 16:20 Re: thread & process |
|
|
|
| A process is normally associated with a single program. The program may be multi-threaded or single-threaded.
|
|
| Back to top |
|
 |
shamrani
Joined: 10 Aug 2004 Posts: 4
|
10 Aug 2004 16:21 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.
|
|
| Back to top |
|
 |
samcheetah
Joined: 25 May 2004 Posts: 672 Helped: 31 Location: Pakistan
|
10 Aug 2004 19:15 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.
|
|
| Back to top |
|
 |
yjkwon57
Joined: 31 Jul 2004 Posts: 221 Helped: 21
|
13 Aug 2004 18:21 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.
|
|
| Back to top |
|
 |
Pinczakko
Joined: 29 Jul 2004 Posts: 140 Helped: 13 Location: Taka Bonerate National Park, Indonesia
|
13 Aug 2004 19:09 Re: thread & process |
|
|
|
| shamrani wrote: |
...
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
|
|
| Back to top |
|
 |
Buddy
Joined: 13 Feb 2004 Posts: 34
|
17 Aug 2004 8:43 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.
|
|
| Back to top |
|
 |