## class waechter

> waechter - your realtime watchdog

### Public Methods

waechter(base_thread &lookafter_, const int priority)
  constructor

## Documentation

> waechter - your realtime watchdog. This Class is a Realtime failsafe system. A realtime thread should ONLY be created using this classes constructor. now if the realtime thread uses too much CPU, it will be downgraded to normal scheduling policy. please ALWAYS use a waechter for realtime threads, otherwise you might have to press the "RESET" button, if your thread is in an endless loop. the realtime thread should check again and again, wether it still has realtime priority. if not, it used too much CPU and should display an error like this: "HEY, BUY A FASTER MACHINE, WILL YOU ?" BTW. a "waechter" is german for "watchdog" :-)

> - Create Thread
> - Create Waechter class
> - Delete Waechter class
> - Delete Thread

> Never disturb this order! The waechter depends on the thread. Never delete the thread, when the waechter is still running. It is your duty to decide, how to maintain this order. you could create the waechter inside the thread. but then, if the thread is canceled, the waechter isn't deleted. so you have to create cleanup handlers (pthread_cleanup_push). An easier way to maintain the order is to create the waechter outside the thread, and delete it before pthread_join'ing the thread. The problem is left to you.

> DANGER! if a thread checks, wether it is still running in realtime too early, it is not yet set to realtime, because the waechter isn't that quick.!! RACE CONDITION. USE MUTEXES, or avoid checking your priority.

`waechter(base_thread &lookafter_, const int priority)`
  constructor. pass your thread_id and your wanted priority. You will then get your priority, and you will be monitored by a waechter.

This class has no child classes.

alphabetic index hierarchy of classes

Mail to the Author

generated by doc++