What is the difference between a process task and threads
and what are the things that are acquired by the child
process from the parent process
Answers were Sorted based on User's Feedback
Answer / renjith
Process is a program in execution or we can say that
process is an instance of a program. Program can have any
number of processes. A new process can be created using
fork()system call. Every process has its own Address space.
All the process Information are stored in a DataStucture
called Process Descriptor or Task Control block or Process
control block or task_struct. when a child process is
created , a seperate address space is created for child
process but it have the same memory image as that of parent.
Child process can share all the resoruces with parent.
After that any exec() executed , then child process
replaces the contents with the new program.
Thread is a light-weight process. We can say that thread is
with in the process . A process can have any number of
threads. All the threads uses address space of the process.
The main difference between Process and a thread is , CPU
switch from one process to another need save the current
information in Process Descriptor and load the information
of new process. But CPU switch from one thread to another
is simple.
Is This Answer Correct ? | 24 Yes | 5 No |
Answer / kiran kumar yakkala
process-independent flow of control,created by fork
(),copies the address space of parent process(all the
contents of parent process i.e data,text,bss ..),resources
are too many, scheduled by system scheduler(cpu)
thread-independent flow of control,created by pthread or
kthreads, resources are less(just pid,ppid,own stack..)so
thats why light weight process, scheduled by thread library
which you are using (ex. pthread , kthread).
usually process can have any no of threads
but threads cannot have process( general rule).
Is This Answer Correct ? | 4 Yes | 3 No |
Answer / dheeraj gahtori
Process is an executing program with several components and
proprieties.
1.exec thread
2. PID
3. priority
4. memory context
5. enviornment
6. file descriptors
7. security credentials.
processes began through a process called "fork and exec".
that is when one command starts another, the child process
first forks , the kernel copying over pages of memory from
the present process to a new location for the child process.
The child then execs, executing the new command and
overwriting the data.the thread is , which controls the flow
of the process. A process needs at least one thread.
Is This Answer Correct ? | 6 Yes | 7 No |
Answer / amit
What is the difference between a process task and threads ?
process and task as synonymous. One or more threads
together form a process. The threads, two or more belong to
same process, share same address space of the process and
can access all the global variable of the process.
Where as two processes can't access each other's address
space and hence cant access their global variable. Two
processes can talk with each other using IPC.
what are the things that are acquired by the child
process from the parent process?
File descriptors [including socket descriptor].
The whole text segment.
Environment variables.
PPID is PID of parent process.
Is This Answer Correct ? | 0 Yes | 5 No |
Answer / achal ubbott
I feel question is what is difference between a process and
thread. A thread is a light weight process i.e. switching
among threads of a process requires much less context
switching(saving contents of CPU registers) as compared to
switching among processes.
Is This Answer Correct ? | 2 Yes | 11 No |
How to Form Traditional Local Addresses?
What are Reserved IP Numbers?
How to Choose a Socket Type?
Why bind system call is required in socket programming?
What is the use of setprotoent(3) Function?
How to Define a Socket?
How to Form Local Addresses?
What does socket consist of?
How to Perform Input/Output of Datagrams?
How to use the socket(2) Function?
How to Understand Network Byte Order?
What is the difference between socket and port?