After considerable testing/frustration, I have determined that the use of POSIX::times() in my Serial I/O application is causing blocks of serial input characters to be occassionally lost (presumably because interrupts, or perhaps task switching, are being disabled for too long). I am using POSIX::times() simply to measure elapsed time with greater than one second resolution (e.g. for receive timeouts).

I looked on CPAN for the "source" code to POSIX, but did not find "enough" code to determine what "times" is doing. I have not used Timer::HiRes as I was hoping to stay with core components for this application.

Configuration: Redhat 9, Perl 5.8.0, 1 or 2 serial ports at 19,200 using POSIX::termios (works fine w/o POSIX::times).

Questions:
1. Does anyone know what the POSIX::times routine is doing ?
2. If I limit myself to one second resolution with "time" am I likely to eliminate the interrupt overrun problem ?
3. When a module is implemented using XS, is all of the code present in a *.pm module, or is there another file somewhere else ?

Thanks.

In reply to POSIX::times() cause SIO overrun by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.