This project contains the workshop materials for the Advanced Programming multithreading session. It has been migrated from Gradle to Maven and structured for clear delivery.
src/main/java/workshop/exercises/: Unsolved skeleton files with clearTODOmarkers. These are the templates to distribute to students and use during live coding.src/main/java/workshop/solutions/: Fully implemented reference solutions for grading and internal testing.
-
LockWorkshop: Resolving race conditions on a shared mutable counter using explicitReentrantLockcoordination. -
SynchronizedWorkshop: Resolving race conditions on a shared mutable counter using intrinsic Java monitors (synchronizedblock). -
DeadlockPreventionWorkshop: Resolving a classic thread circular wait condition by enforcing global lock ordering based on unique Resource IDs. -
TaylorSeries: Implementing high-precision math withBigDecimaland calculating the Taylor series for$\sin(x)$ using a thread pool (ExecutorService).
- Java 17 or higher
- Apache Maven 3.6+
To compile the project:
mvn clean compileTo execute any of the workshop main classes (for example, the Lock Workshop solution):
mvn exec:java -Dexec.mainClass="workshop.solutions.LockWorkshopSolution"