Fast Nuces selects a student to solve teen talwar traffic intersection problem.The details of problem are as follows: in two one-way roads as shown below, traffic is trying to pass through this intersection of roads, such as east to west and north to south without any collision, the intersection road is origin point for cars. Cars have to exit in the opposite direction, therefore cars need to pass through intersections. In this problem, cars are not allowed to take turns. Inside an intersection, more than one vehicle can get in and given that a car's path will not create a collision. Due to some construction problems in this area, a maximum of three cars can get inside the intersection at the same time. Create a program with proper synchronization as per provided scenario.
Clone the project
git clone https://github.com/saad0510/road-intersection-problemGo to the project directory
cd road-intersection-problemCompile the program
gcc main.c -o main.out -lpthreadStart the program
./main.outThe project is only compiled for unix based systems
- github : @saad0510
- email : ayyansaad46@gmail.com or k200161@nu.edu.pk
_April, 2022
