On Fri, Jul 07, 2000 at 06:38:18PM +0100, Jason Shouler wrote:
> [EMAIL PROTECTED] wrote:
> 
> > It's semi-true, but not really interesting.  That is there are parts
> > of the "kernel" that run with interrupts disabled, but parts that
> > don't, and nothing lasts very long.
> 
> Are the parts where interrupts are enabled pre-emptable? If a rt task is
> executing one of these interruptible regions of code and an interrupt
> comes in
> that makes a higher priority rt task runnable, will the task switch occur
> 
> immediately or is it delayed until the first task has finished the
> "system
> call" (OK, it's not a system call in the Linux kernel sense, but you know
> what
> I mean).


This depends on the interrupt and interrupt handler. If the handler 
calls rtl_Schedule (directly or indirectly) there will be an immediate
switch, but if not the switch wil be delayed until the scheduler runs
again. So
        my_isr:
                pthread_kill(highestprioritythread,RTL_SIG_WAKEUP);
                return

will return to the theard that was running when the interrupt came in,
and the resched will happen only during the next run of the scheduler 
(at the latest, during the next timer interrupt).
But
        my_funny_isr:
             rtl_wakeup_np(higestprioritythread);

will switch at once (unless the thread is on another CPU).

Threads are preemptable and RTkernel services are 
either atomic or preemptable. 

Hope that answers your question.




-- 
---------------------------------------------------------
Victor Yodaiken 
FSMLabs:  www.fsmlabs.com  www.rtlinux.com
FSMLabs is a servicemark and a service of 
VJY Associates L.L.C, New Mexico.

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