<p dir="ltr">On Nov 27, 2016 9:44 AM, "Ricardo Biehl" <<a href="mailto:rbpoficial@gmail.com">rbpoficial@gmail.com</a>> wrote:<br>
><br>
> As a question I've made on Stackexchange<br>
> <<a href="http://stackoverflow.com/questions/40579919/how-many-time-to-be-context-switched">http://stackoverflow.com/questions/40579919/how-many-time-to-be-context-switched</a>>:<br>
><br>
> I'm developing a real-time program where scheduler's context-switches<br>
> might interfere its performance.<br>
> ---<br>
> Suppose I need to do many consecutive (but optional) operations (I<br>
> mean I'm able to cancel some of them) of the same type in every<br>
> execution of a timer-oriented signal handler.<br>
> Could I check how much time left until my thread get context-switched?<br>
> [...] and then I can cancel/jump some operations for a better<br>
> performance at all.<br>
><br>
> If yes, how can I do it (in C code)?<br>
></p>
<p dir="ltr">If you use SCHED_FIFO, then at the right RT priority level, you should not context switch anyway. Time quantas apply only to regular CFS tasks or when RT throttling is activated.</p>
<p dir="ltr">Also note that interrupts and softirqs cause variability and interruptions no matter what you do or how you schedule.</p>
<p dir="ltr">J.</p>
<p dir="ltr">> Huge thanks!<br>
><br>
> --<br>
> Ricardo Biehl Pasquali<br>
><br>
> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies">https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br></p>