enqueue/dequeue in mbuf.c
Eric Norum
eric at skatter.USask.Ca
Wed Apr 29 16:22:06 UTC 1998
"erik.ivanenko" <erik.ivanenko at utoronto.ca> wrote:
> Just a quick question...
>
> Should the enqueue/dequeue routines be protected by a _ISR_disable
> and _ISR_enable pair? I'm worried about this situation:
>
> task B at priority X ( or higher ) is waiting for an event
> task A is a preemptible task of priority X that uses the
> enqueue/dequeue primitives of mbuf.c
> an interrupt fires
> task A yields control to the ISR
> the ISR issues the event to wake task B
> task B then becomes runnable, and is of higher or equal priority of
> task A
> task B then runs, and uses enqueue/dequeue primitives
>
> Is that possible?
>
Don't worry.
Be happy.
There isn't a problem.
The situation you describe ``can't happen''. A task which wishes to
execute network code must first obtain the network semaphore
(rtems_ka9q_semaphore) so there's no chance that two tasks can be
active in enqueue/dequeue at the `same' time.
Have a look at the c/src/lib/libka9q/NOTES for complete details. By
using a mutex like this I was able to remove all interrupt
disable/enable pairs from the KA9Q network code.
This is why there's the caveat that interrupt service routines must
not call network code!
---
Eric Norum eric at skatter.usask.ca
Saskatchewan Accelerator Laboratory Phone: (306) 966-6308
University of Saskatchewan FAX: (306) 966-6058
Saskatoon, Canada.
More information about the users
mailing list