pnikitakis / thread-concurrency-problems

3 different problems solved with multithreading. University project [no.2] for Concurrent Programming (Fall 2017).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

thread-concurrency-problems

3 different problems solved with multithreading. University project [no.2] for Concurrent Programming (Fall 2017).

Description

Problem A:

Create Mandelbrot set by dividing into N parts, where each calculates has an individual painting work. Implemented by having each part of the work assigned to a thread that returns to the main thread, which paints the results.

Problem B:

Control the traffic over a 2-way bridge, so that:

  • There are no cars moving both ways
  • There are no more than N cars on the bridge at any time
  • There can't be any car waiting forever Implemented with 2 threads in each entrance of the bridge, by using semaphores.

Problem C:

A roller coaster fits N passengers and starts only when it's full. Passengers get off when the roller coaster has finished the ride and before the new passengers come. Implemented a synchronization between passengers and roller coaster, where there is one thread for passenger and one for the roller coaster.

Prerequisites

  • C
  • Make (sudo apt install make)
  • GCC (sudo apt install gcc)

How to run

On terminal, run make to build the executable C program.
Start each problem's program with ./[program name].

Authors

Course website

ECE321 Concurrent Programming
Assigment instructions can be found here in Greek.

About

3 different problems solved with multithreading. University project [no.2] for Concurrent Programming (Fall 2017).


Languages

Language:C 94.1%Language:Makefile 3.0%Language:C++ 2.9%