Hi zulu4711,

On Thu, Dec 21, 2017 at 03:06:14AM -0700, zulu4711 wrote:
> 
> Yes, it seems like a threading violation like I had before and this is
> surely because of me not having a full insight to what is legal to call and
> what is not legal to call in the stack when running in threaded mode.
> 
> I checked, and I called ppp_close() from another thread than I called
> ppp_input() and I guess thats a big "no-no" ?

Of course it is, almost all ppp_* functions are *NOT* thread safe. You 
have to use pppapi_* functions outside the lwIP core thread.

While we are at it, I did not bother reading your code for correctness 
on this part, please check your PPP input function, only 
pppos_input_tcpip input method is thread safe.

You really should read the PPP documentation.


> It seems that 75% of the problems newcomers like myself is due to 
> threading problems.

Because threading is hard, it is really, really hard. This is why each 
time you call a function you have to ask yourself whether you are 
allowed to call it in this context or not.

On a more general note, that not necessarily apply here, before starting 
a project you should ask yourself whether a RTOS is actually necessary, 
generally it's not, from a not necessary at all to can be easily avoided 
range. Not using an RTOS makes everything an order of magnitude simpler, 
despite the overall belief of the contrary.


Sylvain

Attachment: signature.asc
Description: Digital signature

_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to