Subject:
|
Re: LNP Packet Handlers on RCX
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Thu, 19 Oct 2000 22:45:51 GMT
|
Viewed:
|
1183 times
|
| |
| |
Michael J Ash wrote:
> 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).
> and therefore doing things like memory allocation, msleep, heavy
> processing, etc. were not good ideas.
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 .
Luis Villa wrote:
> I seem to recall something about LNP not being completely thread
> safe. However, there is no documentation on that at all.
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. 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).
> Stig Neilsson (if he is around) may be a good person to ask, since he has studied the
> threading model in detail, and would probably know where LNP may or may
> not override things that it shouldn't.
I also think that Stig Nielsson or Markus Noga can tell more what happens if
the RX handler is blocked by an lnp_handler for a sufficiently long time.
--
Marek mbrudka@elka.pw.edu.pl
|
|
Message has 2 Replies: | | Re: LNP Packet Handlers on RCX
|
| (...) Markus can just about definitely handle any questions. Unfortunately, he no longer responds to much of anything. :| Anyway, thanks for the detailed response, Marek... Luis ---...--- "It's clear to us that Microsoft isn't the competition (...) (24 years ago, 19-Oct-00, to lugnet.robotics.rcx.legos)
| | | Re: LNP Packet Handlers on RCX
|
| (...) started dabbling (...) interrupts (...) from the (...) 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 (...) (24 years ago, 20-Oct-00, to lugnet.robotics.rcx.legos)
|
Message is in Reply To:
| | LNP Packet Handlers on RCX
|
| 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 and therefore doing things like memory allocation, msleep, heavy processing, etc. were not good ideas. (...) (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
|
|
|
|