Bachelor Course on Concurrency
Please contact Trevor L. McDonell <email@example.com> for any enquiry about the course, mentioning [INFOB3CC] in the subject.
Office hours are Mondays 13:00 to 15:00 in BBG 5.68.
By the end of the course you will be able to:
- Design and implement a multithreaded application in Haskell, using
techniques and concepts such as:
- Managing threads
- Synchronise with locks, semaphores, etc.
- Data-flow parallelism
Understand the difference between concurrency and parallelism and where techniques for each can be applied to solve problems
Calculate the complexity (work and span) of parallel algorithms
- Reason about the properties of a concurrent algorithm
14 Jan 2020
To debug the functions in the quickhull assignment, you can use the following: First define a variable containing the input in your Haskell file:
input1 :: Acc (Vector Point) input1 = use $ fromList (Z :. 15) [(1,4),(8,19),(5,9),(7,9),(4,2),(3,9),(9,16),(1,5),(9,11),(4,0),(8,18),(8,7),(7,18),(6,18),(4,19)]
This corresponds to input file
input/1.in. Open the file in GHCi using
stack repl src/Quickhull.hs. You can now test the functions leftMostPoint and rightMostPoint with
run $ leftMostPoint input1.
If you want to test an exercise which is nested in
initialPartition, then you should change the last line (
T2 headFlags newPoints) to
error $ show $ run xwhere
xis the name of the array that you want to inspect. Call the function with
initialPartition input1. You can do the same to test
partition, but note that you will then need to call this function with the output of
initialPartition, thus run
partition $ initialPartition input1.
:rwhen you made changes to the file. This command will reload the file in GHCi.
21 Nov 2019
You can use the program
TomJudge.exeto help evaluate your work (windows only, sorry). It will run a number of test cases and give you feedback on what you can do to solve problems.
Place the executable in the root directory of your project (next to the
iban-calculator.cabalfiles). Make sure your program is up to date (
stack build) and then run the tests. It will look for your program in the build directory, but you can also explicitly pass the location of the executable as an argument on the command prompt. If everything is okay, the tests will turn green. If it is not (yet) okay, some things will turn red; click on the test case for more details.
19 Nov 2019
The starting framework for the first assignment has been updated. The new template now contains utilities to parse the command line arguments and to validate a hash of an account number. You can find it on the assignments page. If you already started with the old template, you can copy some functions of the new template to your code.
- You have to implement two different locks. A nice solution is to use a type
class for that,
class Lock l where ..., containing a function like
interlocked :: l -> IO a -> IO a. You can also choose to create a single data type with two constructors:
data Lock = LockMVar (MVar ()) | ....
- You have to implement two different locks. A nice solution is to use a type class for that,
15 Nov 2019
The solutions for the first werkcollege are now available.
We noticed that some people had trouble using online Haskell compilers (e.g. repl.it) when reading console input in question 6. I recommend that you install Haskell locally using
stackto avoid such problems.
10 Oct 2019
Welcome to the website of the University of Utrecht course on Concurrency for the 2019-2020 academic year.