Subject:
|
LNP not multitasking proof ?
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Thu, 2 Dec 1999 02:41:36 GMT
|
Viewed:
|
1075 times
|
| |
| |
Hi there, during my study of LNP i just stumbled across a point where i
doubt it's not multitasking proof.
it's related to transmissions of lnp-messages.
lnp_logical_write() is ok, it waits for semaphore tx_sem at the
beginning and posts the semaphore before return.
However, the callers of lnp_logical_write(), namely:
lnp_integrity_write() and lnp_addressing_write() both use the global
lnp_buffer[] to construct their packets. Thus, if several tasks call
either lnp_addressing_write() or lnp_logical_write() simultanously, they
will all write to the same buffer before the semaphore check is done.
The transmission machinery itself will work, but most probably with
unexpected results on the receiving side.
My suggestion: do the semaphore check & post in both
lnp_integrity_write() and lnp_addressing_write(), (and the other 6
lnp_xxx_write functions that are still to be invented as well ) and omit
it from lnp_logical_write().
|
|
1 Message in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|