Leon Woestenberg wrote:
Hello all,
this is very late reply.
On Sun, 2006-10-22 at 07:44 +0100, Kieran Mansley wrote:
On Fri, Oct 20, 2006 at 11:37:23PM +0100, Jonathan Larmour wrote:
With the current code, I think the only solution is SYS_LIGHTWEIGHT_PROT.
My opinion is that the !SYS_LIGHTWEIGHT_PROT stuff should probably just be
removed.
Thanks for the detailed post - good to see folks getting to grips with
the stack. The above seemed to summarise quite nicely and I agree
completely with that.
I completely agree with you; It's good to see there is interest in the
lwIP stack from developers that are concerned abouts its correctness.
The SYS_LIGHTWEIGHT_PROT protection was introduced by one of the
developers using the stack to protect *ONLY* between interrupt context
and single-thread user-space context if I am not mistaken.
I am all for removing it, because the locking solution does not scale
across different platforms.
I was actually arguing the other way round I'm afraid :-). I was arguing
that it looks to me that SYS_LIGHTWEIGHT_PROT is essentially mandatory
because packets arrive asynchronously and so pbuf allocation needs to have
some protection no matter what since the allocation will take place from a
device driver. That would be true whatever the context, or whether single
or multi-threaded.
The !SYS_LIGHTWEIGHT_PROT code simply doesn't give any thread or interrupt
safety at all. So in fact the !SYS_LIGHTWEIGHT_PROT code does not appear
to solve the problem it seems intended to solve. Hence me saying that that
code should be removed entirely since as far as I can tell it doesn't
achieve anything. If protection is needed, something using
SYS_LIGHTWEIGHT_PROT is the solution.
Jifl
--
eCosCentric http://www.eCosCentric.com/ The eCos and RedBoot experts
------["The best things in life aren't things."]------ Opinions==mine
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users