Barabanov> You should only use pthread_make_periodic_np.

What if we need a long period?  The period in "pthread_make_periodic_np"
is defined in units of nsecs and of type "hrtime_t" which is typedef'ed
as,

        typedef long long hrtime_t


"Long long"?  How many bits is that on a Pentium?  It appears to be
"only" 32 which would make the longest period ~4.3 secs = 2^32/10^9
(or since "long long" is signed, maybe ~2.2 sec = 2^31/10^9).  So, a
work-around would be necessary.

If I wanted a period of, say, ~8.6 sec, I could schedule a thread with
period 2^32 (assuming the bits are treated as unsigned).  After the
second execution of this "timer thread", I could set a "flag"
indicating the end of the ~8.6 sec period. (BTW, I am interested in
much, much smaller periods: 15 - 25 usecs.  However, in future apps I
might need longer intervals).

That's why I though we might use the (now deprecated) "pthread_setperiod_np"
function since its period is specified (in the "GettingStarted.txt"
document) via a "itimerspec" structure (which allows longer "timespec"
intervals).

I'm happy either way ... but was wondering what other's might think
about the issue of "longer" periods and whether, in fact,
pthread_setperiod_np might be of use in certain situations.

-- 
Prof Kenneth H Jacker       [EMAIL PROTECTED]
Computer Science Dept       www.cs.appstate.edu/~khj
Appalachian State Univ
Boone, NC  28608  USA        


-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/

Reply via email to