Subject:
|
Re: LNP Packet Handlers on RCX
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Fri, 20 Oct 2000 21:34:09 GMT
|
Viewed:
|
1242 times
|
| |
| |
> > I remember reading somewhere a while back, when I first started dabbling
> > with LNP, that LNP handlers on the RCX side were called from interrupts
>
> In legOS v0.2.3 and probably in v0.2.4 they are still called from the
> interrupt handler (rx_handler).
Yes. lnp_integrity_handler() and lnp_address_handler()s are still
called from IR byte receiving interrupt. No problem in the actual
implementation (taking care of it) but it should be a nice thing
to separate byte receiving from packet handling. Should be in the
TODO file... :-)
> The interrupt handling should be fast, hence any heavy proccessing in
> lnp_handler is discouraged. Msleep, malloc and similiar functions can block the
> lnp_handler, so they also shouldn't be called in lnp_handler. Otherwise your
> programs can behave randomly:
> sometimes they execute correctly, sometimes they hang up .
I think so. It's a bad behavier using msleep() in a interrupt
handler.
> Thread safe does not mean the interrupt safe. These are two distinct cases.
> Msleep, malloc, free are , or at least should be, the thread safe functions,
> as there are few semaphores to control the resources.
They are.
> Multitask writing in LNP of legOS v 0.2.3 was not a thread safe because
> there was a small bug in the kernel (Martin Cornelius provided a patch
> with LNPD).
This patch is already included in legOS 0.2.4. I've personally
verified this piece of code.
Bye,
Paolo.
---
Fett's Law: Never replicate a successful experiment.
|
|
Message has 1 Reply: | | Re: LNP Packet Handlers on RCX
|
| Hi, I think some things need clearification: 1. lnp_address_handler() is called from interrupt. It may not sleep. There is sample code how to do the packet handling, sleeping and malloc()'ing in legOS/kernel/program.c 2. Interrupts or functions (...) (24 years ago, 20-Oct-00, to lugnet.robotics.rcx.legos)
|
Message is in Reply To:
| | Re: LNP Packet Handlers on RCX
|
| (...) In legOS v0.2.3 and probably in v0.2.4 they are still called from the interrupt handler (rx_handler). (...) The interrupt handling should be fast, hence any heavy proccessing in lnp_handler is discouraged. Msleep, malloc and similiar functions (...) (24 years ago, 19-Oct-00, to lugnet.robotics.rcx.legos)
|
6 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|