Thursday 13 October 2011

Exercise 3

1. Compare Multi-core processing to parallel processing in terms of speed, number of tasks you can process at a time.
Parallel processing is able to handle more tasks at the same time and at a faster rate compared to a multi-core processing. This is because there are more engines (CPUs or cores) in parallel processing. It can also be done by connecting computers in a network. It increases speed as it is able to handle different portions of a single program by dividing it among processors.

2. What is threading in multi-tasking? Does it make the processing faster or slower?
On a single processor, threading generally occurs by multitasking, which is also known as time-division multiplexing . The processor switches between different threads. This context switching generally happens frequently enough that the user perceives the threads or tasks as running at the same time. On a multiprocessor or multi-core system, the threads or tasks will actually run at the same time, with each processor or core running a particular thread or task. Therefore, it makes processing slightly faster.

3. What is pipelining? Can it be used with parallel processing and multi-core processing?
Pipelining is a set of data processing elements connected in series, so that the output of one element is the input of the next one. The elements of a pipeline are often executed in parallel or in time-sliced fashion. This is similar to an assembly line at a factory. It can also be used with parallel processing and multi-core processing. This is when each loop is split into stages and threads operate on different stages from different iterations concurrently. On the other hand, when multiple cores are assigned to a pipeline stage, its throughput increases linearly, ideally. Thus, to speed up a pipeline workload, we assign more cores to the slowest stages to balance the throughput. However, often the programmers are unable to balance the pipelines completely, leading to thread-waiting, thus defeating the purpose. 

No comments:

Post a Comment