-
March 20th, 2001, 06:36 AM
#1
What is the difference between process and thread
Can anybody tell me the difference
between process and thread?
-
March 20th, 2001, 07:04 AM
#2
Re: What is the difference between process and thread
Hi !,
In theory, If I have understand what you mean with proccess and thread, here you are:
- Process: It is created in a different space than the program so it has own variable space, to share data with another proccess it needs to make change of context and you have to find a complicated way ( like global memory...).
- Threads, they are created in the same space than the proccess that created it, so you can use the same space of variables, and it needs not to make context changes to cooperate with the parent thread, so it goes faster, one bad thing, is that to access to variables you need to use somethings ( Mutex, Critical Sections, Semaphores), to avoid that to threads make changes at the same time in one variable.
Hope this helps, Bye !
Braulio
-
August 30th, 2021, 12:03 AM
#3
Re: What is the difference between process and thread
The processes and threads are independent sequences of execution, the typical difference is that threads run in a shared memory space, while processes run in separate memory spaces.
- A process has a self-contained execution environment. A process generally has a complete, private set of basic run-time resources; in particular, each process has its own memory space.
- Threads exist within a process — every process has at least one. Threads share the process's resources, including memory and open files. This makes for efficient, but potentially problematic, communication.
An example keeping the average person in mind:
On your computer, open Microsoft Word and a web browser. We call these two processes.
In Microsoft Word, you type something and it gets automatically saved. Now, you have observed editing and saving happens in parallel - editing on one thread and saving on the other thread.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|