Directi Interview Question Software Engineer / Developers
0of 0 votesGive some important differences between threads and processes.
When should I use thread and when should I use processes?
You are given a single processor. Will it be still beneficial if I use threads to parallelize my work? Explain with reasons. If yes, give me a case.
Not necessarily, because a single processor any how will process only single thread at a given point of time, so in that case we can use a single process only to complete our work
different processes occupy different memory locations, whereas different threads of the same process share the same code space.
So it will save a lot of time by using the same cache content, instead of fetching the code everytime the process switches(which will be the case if threads are not used)

thread is a light-weight process.........
- zak on September 03, 2010 Edit | Flag Replyyes it is beneficial to use threads to parallelize work...its gonna be multi-tasking..