rt_com call-back function
Pieter van der Meer <[email protected]> Wed, 16 Feb 2005 12:59:57 +0100
| Newsgroups | gmane.linux.real-time.rtlinux.general |
|---|---|
| Message-ID | <[email protected]> |
Hi everyone, Recently, I've tried to run serial communications in real-time using RTLinux. For this I use the rt_com module. Since the module doesn't offer blocking reads I made my own blocking read with time-out. I used the call-back function to wake up my real-time thread when the UART's read FIFO is triggered. The time-out feature was done by a nanosleep with an interval proportional to the number of bytes to read. This seemed to do the trick, and the whole thing runs very efficiently. However, when I looked I looked at the Linux system clock I noticed it jumped around like a madman. Once of twice per minute it does jumps of 4 seconds. After some investigation it seemed the rt_com call-back function was the cause. I disabled the call-back and made the thread periodic. This seemed to stop the jumps from occuring. The way it runs now is very satisfying. However, I still would like to have some insight into the flaws of this call-back mechanism. My guess is it disables interrupts for a long time, which causes the system timer to malfunction? Can it be that "pthread_wakeup_np()" also contributes to this effect? Does anyone share similar experiences? My setup is a 350 MHz PII with kernel 2.4.20, RTLinux 3.2-pre2, rt_com 0.5.5. Kind regards, Pieter van der Meer _______________________________________________ Rtl mailing list [email protected] http://www2.fsmlabs.com/mailman/listinfo/rtl