/concurrent-computing-examples

Examples of implementation of concurrent computing made in C and Java for the discipline of Concurrent Computing at the Federal University of Rio de Janeiro

Primary LanguageCMIT LicenseMIT


Conc. Comp. Examples

Made by Thales Macena Top Language Last Commits Top Language

🗂 Table of Contents

📑 About

This repository is a list of examples of the implementation of concurrent computing done in C using the POSIX Threads library, built during the discipline of Concurrent Computing at the Federal University of Rio de Janeiro and taught by Prof. Silvana Rossetto (DCC-- UFRJ)

It is recommended that you use a Linux, macOS or WSL system if you use windows to run and run programs

🧩 Examples

First notion of creating threads to create a hello world in multiple threads and present the concept of concurrent computing

Shows the use of threads to manipulate arrays, increasing the value of each position by 1

Program that performs the multiplication of a matrix by a vector, has a sequential version and versions with different concurrent solutions.

Program that performs the multiplication of a square matrix by a square matrix, has a sequential version and a concurrent version. In the folder you will also find a benchmark analysis on the advantages of a concurrent approach.

Program that traverses an array of double and adds their values

Program that use threads to calculate a aproximation to pi value

Program that use threads to calculate array prefix sum

First notion of creating threads in Java to create a hello world in multiple threads and present the concept of concurrent computing

Program that use threads to calculate increment a variable

Shows the use of threads in Java to manipulate arrays, increasing the value of each position by 1

Shows the semaphore example in threads

✨ Installation

Open a terminal and run the following commands:

# To copy this repository
git clone https://github.com/thalesmacena/concurrent-computing-examples.git

# To move to project directory
cd concurrent-computing-examples

🔥 Running

You can open powershell as wsl with the command:

wsl code .

You can run each example by running its respective .exe file or build with the command:

gcc fileName -o exitName -Wall -lpthread
./exitName args

You can compile and run with java with the following commands:

javac Main.java
java Main