Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

MUNCHEN TECHNISCHE UNIVERSITAT Lehrstuhl f ur Integrierte Systeme

Chip Multicore Processors Tutorial 4


May 22, 2013

Task 4.1: Counter Implementation


You want to share a counter among several threads. Implement the counter with locks, compareand-swap and load-linked/store-conditional. How is each of the implementations characterized?

Task 4.2: FiFo Implementation


In this task you will implement a FiFo memory in software. a) Implement a (capacity bound) FiFo as circular buer by using an array. b) Allow the parallel access to the FiFo by multiple threads using locks. c) Is it possible to use two locks for parallel access by reading and writing threads? d) Use a (POSIX) condition variable for synchronization. e) Can you implement this data structure in a non-blocking fashion? If not, how can you change the data structure to allow for it? f) Is it possible to implement an (unbounded) FiFo by using a linked list and without locking?

You might also like