views:

39

answers:

1

I am reading data from a HID device using hiddev , there is a dedicated thread to read off of it, but it seems that thread is dropping some packets. I can see the packets in the kernel buffers(usbmon) but some of them don't reach user space. The reads inside the reading thread mostly finish on time(~4ms). I think the process is not getting enough processor time, thus the kernel fills its queue and drops the packets, by the time the process gets to read them it only finds tails or nothing at all?!

Any sugestions I have been thinking in increasing the proiority of thread?! what is the appropiate function?

Thanks guys

+1  A: 

Use pthread_setschedprio() from librt.

MArag
I decided to bump the whole process to real time with sched_p.sched_proirity=20; //real timesched_setscheduler(getpid(),SCHED_FIFO,
Stb