Skip to content

brennnnan/trains

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Trains

A Project for CSC360 Operating Systems in Summer 2015 that works as a train dispatcher for a bridge. The program recieves a list of a trains with the direction they are heading, their priority, and their load and cross time. It creates an array of structs housing each train and the trains all start loading at the same time. The trains tell the controller thread when they are ready to cross (done loading), and the controller checks if they should be allowed to cross (there is a mutex that acts to guard the track from overexcited trains). The decision about which train goes first is a combination of the load time, direction, wait time and priority of the train. When the controller thread decides which train should be allowed to cross, it notifies that train and unlocks the mutex guarding the track.

###Concepts:

  • Multithreading
  • Condition Variables / Mutexes
  • Signals

About

Train dispatch scheduler in C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published