Skip to main content

Adding timeouts to micro:bian

Supervisor

Suitable for

MSc in Advanced Computer Science
Mathematics and Computer Science, Part C
Computer Science and Philosophy, Part C
Computer Science, Part C
Computer Science, Part B

Abstract

For some of the tasks that follow, it will help to add a new form of the receive system call that provides a timeout. This does express something that can't be done with a timer process and ordinary receive. That's because it isn't possible to cancel an alarm call from the timer process without risk of deadlock: if the client process decides to cancel the alarm call at the same time the timer process decides to deliver it, then they are stuck in a deadly embrace, each refusing to receive a message the other is committed to sending. Moving the timeout into the kernel allows it to be cancelled automatically when the receive completes.

A suitable API will allow micro:bian to continue to function without a timer process, but allows a timer process to be installed and, via a special system call, to inform the kernel of the passage of time.