Hi,
 
I've few doubts the pre-emption capabilities of RT-Linux. If a periodic task of Computation time C and period P. Then, in case C>P, then does the RT-Linux scheduler pre-empt the over-running task pre-empt and schedule other tasks.
 
I'm asking this because an explicit call is made o pthread_wait_np() function which schedules it.
 
I can summarize my problem like this :
 
Let my task1 program be :
 
while(1)
{
    pthread_wait_np();
    while(1)
    {
        // I won't put any pthread_wait_np() here but can the scheduler interrupt me???
 
        rtl_printf("Task1");
    }
}
 
Let my task2 program be :
 
while(1)
{
    pthread_wait_np();
    while(1)
    {
        // I won't put any pthread_wait_np() here but can the scheduler interrupt me???
 
        rtl_printf("Task2");
    }
}
 
I expected an output of "Task1" and "task2" interchangeably.
 
I modified the examples/hello.c to put this code and found that my system crashed and didn't do anything else.
 
Am I doing somehing wrong ? ( I know that if I put pthread_wait_np() in inner loop, it will work- but that doesn't explain the preemption capabilites of RT-Linux).
 
Expecting your reply,
 
Thanking in advance,
 
Swaminathan
 
------------------------------------------------------------------------------------
Swaminathan Sivasubramanian
http://www.swaminathans.com
 

Learn from the mistakes of others -- you can't live long enough to make them all yourself.
 
 

Reply via email to