while(variable > 0){
updatevariable(); //variable gets updated from UDP serevr.
// i want to execute a shell command here without blocking current execution.
}
i tried using system() function but it is blocking current execution, i should be able to stop the shell command if the condition doesn't satisfy and shouldn't wait until the shell command finishes execution. (the shell command i'm using is rtl_fm and it doesn't stop execution until we manually stop it). i'm writing this code specifically for linux OS. And i exactly know the time when the variable falls below 0. is there any way to execute shell command for certain period of time?
haven't tried process, threads yet. PS: This is my first question on this platform.