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.
Answers were Sorted based on User's Feedback
Answer / sumant kulkarni
I really feel, using threads in this situation is wastage of
resources. Using a single process would be the right choice.
This avoids context switching between threads.
Is This Answer Correct ? | 34 Yes | 4 No |
Answer / sandeep patra
we use threads for sharing the CPU parallely between
multiple executable entities. now if T1, T2 and T3 are going
to perform sequentially one after another then its better to
have a single process as we are not achieving the
parallelism here.
Is This Answer Correct ? | 13 Yes | 3 No |
Answer / kk
As the execution of the threads are strictly dependent of
finish to start relationship, so using different theads
won't give any benifit except modularity of the
functionalities even if we use multiprocessor system. and
even the process can have multiple functions for the job
that individual thread is doing.
Sumant Kulkarni:
"I really feel, using threads in this situation is wastage
of resources. Using a single process would be the right
choice. This avoids context switching between threads."
Are you sure there will be context switching among threads?
Look, here the threads execution is sequential not
parallel. they are dependent of previous thread to finish
to start.
As the threads T1, T2, T3 are to be executed sequentially,
so first T1 will execute and once the control reach the end
the thread will exit, like that T2 and T3 will exit once
the control reaches the end of the function executed by
that thread. so is there really a need for the OS to do
context switching??? No right.
Is This Answer Correct ? | 10 Yes | 4 No |
Answer / nitesh
The only benefit here is increase in modularity of the
program where each logical unit can be separated by threads
Is This Answer Correct ? | 10 Yes | 5 No |
Answer / sh
Question is not about advantages of threads over process,
it's explicitly sayed sequential execution so though t1
blocks for unknown time T2 will be executed only after T1
so there is no point in going for 3 threads over having a
single process, but if was not the above case then it's
highly recommended to have three threads,
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / 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 |
Answer / hari
hi friends....this is the answer as per my knowledge....
every body are saying in all the ways.....nobody have thought
or tried to think on what conditions this question do
apply.....is that three threads are running at server side
or client side....or in a stand alone system.......this is
not the matter of usage of resources all here matters is how
the user is using the systemand his requirements......if he
wants his system to perform very fastly and number of tasks
in a single shot then the concept of threads comes into
picture which automatically increases the speed....and its
obvious of using the resources.....so answer to questions
differ according to the application or the conditions
apply.............
Is This Answer Correct ? | 2 Yes | 7 No |
Answer / guest
Yes there is benefit,If we want to execute fast three
different instructions at same time than multithreading
concept is important and if we wanna that 1 thread execute
and get killed and we again create another for nerxt
instruction in that case we can go for a single threwad.
Is This Answer Correct ? | 2 Yes | 9 No |
Answer / alka
thread is faster than process b'coz switching betwn threads
is easier & faster.
3 threads can divide work together...ex: input,
output,operation etc.
it shares memory within process.
Is This Answer Correct ? | 5 Yes | 13 No |
Answer / vivek
here T1, T2 and T3 as a thread consumes less memory and
more speed
but as a process it consumes more memory.
Example:
Multiple threads can be run within a single memory
allocations.
but process needs seperate memory allocations for each
process.
Is This Answer Correct ? | 4 Yes | 20 No |
How many threads can one core handle?
What does 4 cores and 4 threads mean?
Are pthreads kernel threads?
Why do we need multithreading?
Do threads share memory?
How many threads can you run?
Whats the difference between a thread and a process?
An extended partition can contain many sub partitions called_______
At installation,Red Hat Fedora Linux creates a symbolic link called _____ to the appropriate cd-rom device
What does threads mean when downloading?
Does hyperthreading reduce performance?
How does hyperthreading work?