Skip to content
Advertisement

Can not achieve real time SCHED_FIFO thread within process

Good day everyone !

I am trying to get a 2nd thread (the serial thread) to run as near real time as possible.

Within my 2nd spawned serial thread I select() with timeout of 3 mS on a serial port.

I also get real time before select() … and then after to get select() delta time.

Problem is that sometimes I get no indication of select returning 0 (what I call a timeout due to the 3 mS elapsing) … but I do occasionally get a total time much greater than the 3 mS (4.447 for example).

I have to conclude that the serial thread is getting preempted?

Any ideas?

What Linux commands can I use to see if the thread is preempted?

Thanks!

JavaScript

Advertisement

Answer

Well no one seems to know why this is happening to me but … … after nearly a year struggling … … I found a post that is exactly what is happening to me.

I post a link so no one else will suffer my fate.

C – select() seems to block for longer than timeout

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement