1,581 views
5 votes
5 votes
Thread is a light-weight sub-process. If so, what is executed by the processor? Process or thread? If it is thread, why do we say that ready queue has processes? Should not we say that ready queue has threads? And if the answer is process, what is the use of threads then? Is thread just another name of a process which is very small in size? What is actually the difference between these two?

Thank you.

3 Answers

5 votes
5 votes
Threads are  small processes which is part of a Big Program . You can compare like divide and conquer . Splitting the big program into small small processes .

ready queue holds the processes . threads are actually a process which is part of big process . ready queue  totally unaware of that its a thread or a process so it will treat like a normal process . And its the duty of that program (big program ) to manipulate each of its threads and how to execute them .
1 votes
1 votes

The process is there in the ready queue. Process have user-level thread which the kernel which schedules process has no idea about. 

Why thread then?

Check this: https://www.tutorialspoint.com/operating_system/os_multi_threading.htm

0 votes
0 votes
Thread is a part of the process.If thread is executing on CPU means,then the process also is  in under execution because the thread is performing an action on behalf of the process. Ready queue don't  know anything about thread because thread is created after it gets scheduled on CPU.Threads are used to divide the process and do the work efficiently

Related questions

0 votes
0 votes
3 answers
2
jayadev asked Feb 1, 2022
952 views
Consider the following program segment of C-programming language:#include<stdio.h int main() { if (fork() || fork()) fork(); printf("GATE\n"); return 0; } Number of times...
0 votes
0 votes
1 answer
3
jayadev asked Dec 7, 2021
433 views
Why the operating system has the knowledge about kernel level threads but not about user level threads?
1 votes
1 votes
1 answer
4
jayadev asked Dec 6, 2021
380 views
Does kernel level threads have separate PCB(process control block)?