Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Thread and Process

What is the best definition of a thread and what is a process? If I call a function, how do I know that a thread is calling it or a process (or am I not understanding it??!). This is in a multi-core system (quadcore).

like image 932
gagneet Avatar asked Dec 10 '22 22:12

gagneet


1 Answers

From http://wiki.answers.com/Q/What_is_the_difference_between_a_computer_process_and_thread:

A single process can have multiple threads that share global data and address space with other threads running in the same process, and therefore can operate on the same data set easily. Processes do not share address space and a different mechanism must be used if they are to share data.

If we consider running a word processing program to be a process, then the auto-save and spell check features that occur in the background are different threads of that process which are all operating on the same data set (your document).

like image 62
Marc Novakowski Avatar answered Jan 24 '23 23:01

Marc Novakowski