| Martin James 2006-08-25, 1:26 pm |
| qazmlp1209@rediffmail.com wrote:
> Assume the processing-1 takes 10 ms and processing-2 takes 10 ms.
> Processing-1 and processing-2 can be done independantly.
> If I have a process with only a main thread, it takes 20 ms to finish
> the processing-1 and processing-2 in sequence. Now, I want to switch it
> to a multithreaded process, where the thread-1(i.e. the main thread)
> will do the processing-1 and thread-2 will perform the processing-2.
> How much time now the process is expected to take?
> Will it be 10 ms, or slightly more than in the range of 11-19
> ms(considering the time required for context-switching between
> threads)?
>
> I understand that this depends on various factors like the number of
> CPUs etc.. But, I would like to know the typical time that we can
> expect.
Assuming these 'processings' are CPU intensive, ie. make no blocking
calls, neglecting the minimal overhead of possible context-switches,
neglecting any other loadings in the box and assuming that the two
'processings' operate on different data, negelcting any time spent on
splitting up a task into 'processings' then I would expect that the time
taken would be inversely proportional to the number of processors.
Rgds,
Martin
|