lundi 23 juillet 2018

periodic thread wakeup without using condition variable or sleep function

I

  1. do not want to use sleep function of high time resolution clock because busy sleep consumes CPU.

  2. I do not want to depend on some wake up call spurious or signal based on some event using a conditional variable as it does not guarantee periodicity.

Please suggest if there is something on these lines possible. I cant find any solution online. I need to implement an eviction policy in a thread which will try to wake up every x seconds and clean up a queue if larger than a particular size.

Aucun commentaire:

Enregistrer un commentaire