Question 4 – Multithreaded Programming [12marks]
a) Compare and contrast the multi-threading approaches of C++ std threads [2 marks] and OpenMP (from a language perspective). Give an advantage of each.
b) Consider the following architecture: [4 marks]
Each Processing Unit PU operates independently and can directly access its local area of memory. It is also capable of reading/writing to the other areas of memory through the interconnect.
i) Classify the architecture in terms of Flynn's Taxonomy
ii) Classify the architecture in terms of memory architecture
c) There is a large dataset of integer keys stored in a linear array and which needs [6 marks]
to be sorted. It has been decided that the quick sort algorithm will be used to sort the array. It is safe to assume that the keys in the array are unique and are initially in a random order.
Describe a design for a multi-threaded solution for implementing the quicksort algorithm with the primary goal of reducing the time taken to find a particular value.
Your answer should:
• Outline your overall approach
• Describe the paradigm it is based on
• Suggest a language/API to use
• Provide a justification for your decisions