...
- Use entry-/exit-actions instead of actions on transitions, if possible.
- If using hostcode, only use functions delivered by our own C-Interface and not the Höhrmann-API.
Deadlock Prevention
- When attempting to reserve more than one segment (Entering a station, passing a junction) a separate protocol for deadlock prevention must be adhered to.
- In each tick the controller must check if only partial permissions were granted.
- If partial permission was granted the train waits for one tick and releases all locks.
- In the following tick the locks are requested again.
- As a special case the controllers passing through KIO_LN_0 or KIO_LN_1 must wait an additional tick after releasing the requests.
- A sample controller can be found in the repository at /doc/deadlocks/resolve_deadlock.sct