Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Monitors and Concurrency

This repository showcases a simple implementation of the monitor concurrent technique for multi-thread safe behaviour.

Overview

The given tasks involved creating robot controllers able to concurrently handle a workflow of sensing, analyzing and actuating. Three threads where created, each one representing an actor within the system: sensor, analyzer, and actuator. The task was approached as an extension to the producer-consumer problem. In this case, the Sensor acted purely as a producer, the Actuator as a consumer, and the Analyzer as hybrid between the two. That being said, 2 buffers connected each of the producers with their respective consumers (sensor-analyzer and analyzer-consumer), and the concurrent technique selected to ensure multi-thread safe behavior was the monitor.

The concurrent simulation cosisted of 3 steps:

Sense

Sensors create k number of tasks every second following a Poisson distribution. These tasks would have a complexity c, evenly distributed between 0.1 adn 0.5.

Analyze

The analyzer would analyze said tasks and send the results to the actuator. The analysis would take c seconds.

Actuate

The actuator would read from those results and move the robot accordingly.

Build and Run

$ ./build.sh
$ ./run.sh

About

Monitors for multi-thread safe behavior.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages