Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many threads can a cpu run?

908


What does 4 cores and 4 threads mean?

852


Which one is better thread class or runnable interface?

862


Are threads processes?

887


Why do we need thread pool?

877


Do threads share program counter?

993


Which thread method is called when a thread starts?

863


Why are threads used?

951


What is context switching between threads?

887


How many maximum threads can you create?

977


What are threads cpu?

985


What are the advantages of threads?

911


What do cores and threads do?

974


Are threads as good as cores?

908


Is face threading bad?

841