<p dir="ltr">Please reply always to kernelnewbies. </p>
<p dir="ltr">On Nov 27, 2016 11:09 AM, "Ricardo Biehl" <<a href="mailto:rbpoficial@gmail.com">rbpoficial@gmail.com</a>> wrote:<br>
><br>
> 2016-11-27 16:01 GMT-02:00, Joel Fernandes <<a href="mailto:agnel.joel@gmail.com">agnel.joel@gmail.com</a>>:<br>
> > 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>
> >> <<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>
> >><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>
> >><br>
> ><br>
> > If you use SCHED_FIFO, then at the right RT priority level, you should not<br>
> > context switch anyway. Time quantas apply only to regular CFS tasks or when<br>
> > RT throttling is activated.<br>
> ><br>
> > Also note that interrupts and softirqs cause variability and interruptions<br>
> > no matter what you do or how you schedule.<br>
> ><br>
> > J.<br>
><br>
> Thank you Joel!<br>
><br>
> Another small question: Can I use pthread_cond_signal[broadcast]() (a<br>
> non async-signal-safe function) inside signal handler, given I know<br>
> pthread_cond_wait() hasn't been called at the same time?</p>
<p dir="ltr">Should be, as per docs it wakes up *IF* any threads are blocked on cond.</p>
<p dir="ltr">Thanks,<br>
Joel</p>
<p dir="ltr">> ><br>
> >> 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>
> ><br>
><br>
><br>
> --<br>
> Ricardo Biehl Pasquali<br>
</p>