Java Traffic Light Problem

Order Description

The objective of this task is to develop a better understanding of process synchronization and deadlock handling.

Traffic light problem is a classical example of synchronization and deadlock handling.

You are required to write a Java or C code to implement Petri Nets Model.

Clearly mention in your code(using comments) the piece of code you have written to address the synchronization and deadlock handling.

Your program should be able to: 1. Ask the user which traffic light they want to be green. 2.Allow that traffic flow for a fixed time of 5 seconds and then both traffic flows and repeat (1) part.