0

I am instanting an object A in the main.

One of its method f consists in getting inputs from a database, computing some values and then updating (write) a database.

I want to call f every x minutes. Let's say f needs y seconds to process.

How can i do that safely for both linux and windows plateform? Of course if the process is killed outside it should not leave the database in an unknown state. Thanks

  • This may be of interest: https://stackoverflow.com/questions/37240834/how-can-we-make-a-loop-with-chronicle-statement-in-c/37241412#37241412 – Galik Oct 08 '16 at 09:29
  • and also this may be of interest: http://stackoverflow.com/questions/21059115/c11-thread-class-how-to-use-a-class-member-function/21239387#21239387 – zahir Oct 08 '16 at 09:31
  • ... also: http://codereview.stackexchange.com/questions/47347/follow-up-timer-utilizing-stdfuture –  Oct 08 '16 at 10:11
  • could it be stopped by kill 15 or kill 9 on unix or Ctrl +c on windows ? Thanks – supermastercode Oct 08 '16 at 13:55

0 Answers0