Say we have three threads T1, T2 and T3 which
perform sequentially one after another is their any benefit
of using thread over here rather than having a single
process.
Answer Posted / vinod
What if T1 waits for some resource -- Let it be some Input
from keyboard. When T1 is in the wait state, T2 and T3 can
be completed hence utilizing the waiting time. If it was a
single process instead of 3 threads, then the code
equivalent of T2 and T3 will have to wait till code
equivalent of T1 is completed which is definitely a waste of
time.
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
Does htop show threads?
What are threads in c?
Is c++ multithreaded?
Are more threads better?
What is the biggest advantage of implementing threads in user space?
How many goroutines are in a thread?
Is creating a thread expensive?
Why do we use threads?
Why is threading bad for you?
Are pthreads kernel threads?
What is a lightweight thread?
How do I check my cpu threads?
What are the two methods to create threads?
How do cpu threads work?
Can hyper threading hurt performance?