I'll take a shot at answering some of your questions.

    First, don't use usleep() unless it's absolutely necessary for more
than a very small number of microseconds.  It's a busy-wait loop that
doesn't give up the CPU.  Find some other way to trigger a task.
    Second, RTLinux keeps a schedule of requested interrupts so it's quite
possible to have a periodic task with, say 10 ms and still get a one-shot
interrupt in, say 42 uSec or any other number.
   Third, the start-time specified in making a task periodic is part of the
schedule.  It's not necessary to set all tasks for the same value, and
probably not desirable either;  if two tasks really share a common period,
then they should probably be both part of a higher level periodic task.

That's not all of your questions answered but it should give you something
to think about before asking for more information.


    Norm

----- Original Message -----
From: Marc Le Douarain <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 29, 2002 6:26 PM
Subject: [rtl] Periodic /oneshot modes & usleep(), nanosleep()


> Hello,
>
> I've just discovered in old mails the meaning of the periodic and oneshot
> modes available in rtl_setclockmode()
> (especially this one:
> http://www.realtimelinux.org/archives/rtl/20001/0240.html)
>
> And it has triggered some questions in my spirit...
>
> By default, in which mode RTLinux is ?
>
> If I'm in periodic mode and on all the periodic tasks, the little period
is
> for example 10 ms, can I set in usleep() or nanosleep() time less than 10
> ms...??? As the timer is programmed to interrupt every 10 ms only !???
>
> Is there a difference between usleep() and nanosleep() (except the unit
of
> time of course ;-) ) ?
>
> In periodic mode, when calling pthread_make_periodic_np( ), is start_time
> parameter taken into account ? So that to optimize the little value of
the
> timer interrupt, we should set the same start_time for all the tasks ?
>
> Finally there was quite a lot of questions... thanks in advance if
someone can
> clarify all that !
>
> Bye.
> ---
>    Marc Le Douarain
>    "[EMAIL PROTECTED]"
>    http://www.multimania.com/mavati
>
>
> -- [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/
>

-- [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/

Reply via email to