Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Operating System (http://www.go4expert.com/forums/operating-system-forum/)
-   -   Threads and Processes (http://www.go4expert.com/forums/threads-and-processes-t24215/)

makarov 19Dec2010 21:49

Threads and Processes
 
Hi guys!

I'm really struggling to find the right answer to this questions, and maybe you guys can give an idea of what is all about.

Can anyone briefly describes, the difference between the relationships between threads and processes in Linux and Microsoft operating systems?


I would appreciate it, if you could answer this nightmare questions as soon as you can.

Thanks,

Mak

neo_vi 22May2011 13:40

Re: Threads and Processes
 
Thread and process are considered same in Linux.
In windows, they are different entities.

Linux sees threads as just a sub-process. The linux method has advantages and less overhead than windows method.

ankitasharma 5Aug2011 15:13

Re: Threads and Processes
 
1)Threads have direct access to the data segment of its
process; processes have their own copy of the data segment
of the parent process.

2)Threads share the address space of the process that
created it; processes have their own address.

3)Threads can directly communicate with other threads of
its process; processes must use interprocess communication
to communicate with sibling processes.

4)New threads are easily created; new processes require
duplication of the parent process.

deadlock 17Jan2012 00:38

Re: Threads and Processes
 
neo_vi: Is this a joke? I never heard anything like that.
Processes and threads are 2 completely different schemes, i think.
Please provide some papers confirming these assumptions :).

ankitasharma is already mentioning the basic things.

Differences between windows and linux processes:
In linux, theres a clean process tree, starting with the "init" process.
In windows, there is apparently no process tree. Processes are addressed by a process handle. Means, window's processes are not relying on a 'clean' process tree. You can think of it as a "visual" process tree, but it' has nothing to do with the real processes.

Linux processes are first copied with fork and then its core image is replaced with
execv (or one of its siblings).
In windows both goes with only one system call: CreateProcess.

Spontaneously I don't remember any large differences between the thread-handling of these os'es.

neo_vi 17Jan2012 07:55

Re: Threads and Processes
 
Not a joke. Linux just sees all the threads as a process. Everything is represented with struct task_struct structure.

deadlock 17Jan2012 20:51

Re: Threads and Processes
 
neo_vi: Okay, got any proof for this? :]

neo_vi 21Jan2012 12:25

Re: Threads and Processes
 
Linux kernel development. by Robert love.


All times are GMT +5.5. The time now is 15:04.