On Wed, Jun 21, 2000 at 09:20:04AM +0100, Stuart Hughes wrote:
> "Stephen D. Cohen" wrote:
> > > I may be mistaken, but I think in RTAI/RTL, you can set a
> > > semaphore from
> > > within the ISR, exit and on exit the real-time task/thread
> > > will run its
> > > code. If it doesn't work this way, it would be nice to have this
> > > facility available as this is typical of the sort of thing I
> > > used to do
> > > with pSOS.
pthread_mutex_unlock
Alternatively: pthread_kill(thread,RTL_SIG_WAKEUP);
Both can be called from an ISR.
> > As far as semaphores go, I demand a stable base for RTL, so I am
> > still using RTL 2.2 on Linux 2.2-14. This version does not contain
> > semaphores as near as I can tell. I am also not certain that semaphores
> > work as expected in V3. Anybody want to fill us in (after answering my
> > original question)?
Jerry has cleaned up semaphores for V3.
> > It seems to me that the semaphore handling routines should simply
> > check to see if anyone is waiting for a semaphore (when it is given) and, if
> > so, call the scheduler. The scheduler should also be called on return from
> > every interrupt. Is this the case?
> >
>
> I think you're correct (RTL & RTAI). IMHO it should be changed so there
> is a way to pend a task to run only when an ISR has exited.
That is exactly what pthread_kill WAKEUP is for.
We have designed pthread_kill to be extremely fast and lightweight and to
not call the scheduler.
But pthread_mutex_unlock also does not call the scheduler and for
exactly this reason.
-- [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/