Real Time Threads on EPOS

Imagine now that the world depends on you to be saved. There is a bomb that must be shutdown IN TIME to avoid a catastrophe. Your program will have two threads: BAD and GOOD. The thread BAD, will, periodically, arm a new bomb to explode after "BOMB_TIME" miliseconds. On the other hand, thread "GOOD" will periodically disarm the bombs. For this, you should use Real Time Threads in EPOS. The GOOD thread will start a period after the BAD thread (if the period of both threads is 500ms, thread GOOD should start 500ms after thread BAD). Your system must run for N iterations. If during these N iterations, the GOOD thread was able to shutdown the bomb everytime the BAD thread activates it, good, we are safe, otherwise ... Pray for your Gods!

Useful Links

Solutions