Institute of Computer Science
  1. Courses
  2. 2025/26 fall
  3. Concurrent Programming Languages (LTAT.06.022)
ET
Log in

Concurrent Programming Languages 2025/26 fall

  • Pealeht
  • Loengud
  • Labs
  • Viited
  • Homework

1. Write a short C/C++ program that prints out the number of cores available.

2. Write a short C/C++ program that executes as many threads as there are cores and prints the thread number of each.

3. Write a short C/C++ program that executes 4 threads and prints the thread number of each.

4. Write a short C/C++ program that executes as many threads as there are cores and sums up the thread numbers plus 1 in a variable and prints that out.

5. Study the program "4-parallel for.txt". What is parallelized here? What would collapse do?

6. Study "5-critical,nowait,barrier.txt" and try out the different options. How are they different?

7. Write a program which initializes an array of size N (defined as variable in the program) to the numbers from 0 to N-1 and then calculate the sum of those numbers. Make the calculation parallel. Make sure there are no problems here with the parallel calculation.

8. Write a program where a number of threads increment a variable and then only the first thread prints out the result.

9. "8-locks.txt" demonstrated locks and compares them to critical.

10. Write an OpenPM program which guarantees that a statement is printed exactly four times.

  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment