vendredi 29 mars 2019

Pause and resume a thread from another thread in a multi threaded environment in C++ technical suggestions

I would like to practice in a multi threading environment and I would like to create a program for an imaginary scenario when the program cyclically save the produced data to prevent data loss into a file in case of a crash. So basically in a multi threaded environment one thread is saving data cyclically into a file and when a crash happens and the program is restarted it will load back the data from this file and can keep going. So I am wondering what direction should look into? I am also wondering about design patterns regarding this matter.

Also I would like to pause this cyclical save thread from another thread, but leave the other threads going, for like a scenario when a shutdown is happening in the program to not save the data.

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire