Thanks Mr. Tyson,

    Your mail was very much informative. I have three real-time threads
that need to run at the same priority. I tried using the SCHED_RR by
explicitly changing the policy and the rt_priority at the start of each of the
threads. The code is something like this.

    lock_kernel();
    daemonize();

    current->policy = SCHED_RR;
    current->rt_priority = 5;

    thread_ID = current;
    unlock_kernel();

    I call schedule() at the end of each stage of processing in each
thread so that the CPU can be given to the other threads for processing.
Is this way yielding sufficient enough or do I need to do anything else.

    Although my code works fine if all the three threads are run with the
SCHED_OTHER policy, it has problems only with the SCHED_RR and SCHED_FIFO
policies.

   1) Will use of semaphores between the threads be a reason for the code
hanging. (But the code works fine in SCHED_OTHER mode).

   2) Can networking stuffs like reading and writing to sockets be allowed
under this policy.


thanks,
Sai.



On Tue, 5 Feb 2002, Tyson D Sawyer wrote:

> Ish Rattan wrote:
>
> > On Mon, 4 Feb 2002, Saikrishnan Krishnamurthy wrote:
> >
> >
> >>    1) Is there any means in linux kernel to offer a kernel thread, a
> >>real-time priority. (I tried assigning the SCHED_RR and SCHED_FIFO to my
> >>threads and it would hang my computer not measuring anythin
> >>
> > Linux kernel has no notion of real-time and hence priority.
>
>
> Uhh... are you smoking crack?
>
> I'm happy to acknowledge that scheduling latencies are rather uncertain
> but it definately knows and respects SCHED_RR and SCHED_FIFO.  I use
> SCHED_FIFO for soft real-time tasks.  They have been supported for a
> LOOOONG time!
>
> I didn't read the original post, but it is more likely that the kernel
> thread never slept and thus never allowed the rest of the system a
> chance to run.  ...as in, it was doing exactly what a prioritized
> scheduler should do.
>
> Also, without the preemptive kernel patch, even a non-realtime thread in
> the kernel will block everything if it doesn't sleep.
>
>
> >
> >
> >>    2) If I code my program under rt-linux would I be able to use the atm
> >>socket features under real-time ??. (accessing atm sockets in nonRT linux
> >>and transporting the packets to real-time linux using FIFOs would'nt help
> >>as I need to receive packets at real-time not just process it).
> >>
> >
> > You will have to take the plunge and try it. You will have to write a
> > real-time ATM driver to tackle the problem.
>
>
> First figure out what the original problem is.  If is a lack of sleeping
> on the part of his real-time threads then he will have exactly the same
> problem under RTLinux.
>
> Depending on system activities, SCHED_FIFO under "normal" linux will
> give you worst case latencies as low as 5ms (if HZ is defined to be
> 1024) and as high as 60ms or so.  Higher might be possible depending on
> activities.
>
> For soft realtime applications I patch the kernel to set HZ to 1024 and
> set the scheduling policy to SCHED_FIFO.  I have recently started using
> the preemptive kernel patch and lock break patches maintained by Robert
> Love.  With this configuration typical latencies are a 100us or so, but
> worst case is still around 60ms for some system activities (hard disk IO
> in particular).
>
> Kernel preemption patches at:  http://www.tech9.net/rml/linux/
>
> >
> > -ishwar
> >
> > -- [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/
> >
>
>
>
> --
> Tyson D Sawyer                             iRobot Corporation
> Senior Systems Engineer                    Military Systems Division
> [EMAIL PROTECTED]                         Robots for the Real World
> 603-532-6900 ext 206                       http://www.irobot.com
>
> -- [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