In my process, I need to start / restart another process. I am currently using a stream with a small stack size and the following code:
void startAndMonitorA()
{
while(true)
{
system("myProcess");
LOG("myProcess crashed");
usleep(1000 * 1000);
}
}
I feel that this is not the best practice. I have no idea about the resources that the call is std::system()blocking or wasting. I am in embedded Linux - so in general I try to take care of resources.
source
share