|Subject:||[lwip-devel] PPP single threaded|
|Date:||Thu, 11 Dec 2008 11:53:49 +0100|
|User-agent:||Thunderbird 18.104.22.168 (X11/20081125)|
Hi thereI've put some work into getting PPP working in a single-threaded (NO_SYS = 1) environment. I've also put some time into refactoring the existing PPP code to match more with the rest of lwIP, mostly renaming though. I've also implemented a really simple 'chat' module, to setup a GPRS connection. Now I wonder if the effort should be made to bring this all back into lwIP. There is still a lot to do, but it would probably be worth it. Let me explain what I changed in the design:
* Added a simple timesys module to PPP, this is ticked by a call to ppp_tmr() like the rest of lwIP. This timesys implements a jiffies counter which PPP needs in some places. It also implements the timeout handlers, which are absent in lwIP for the NO_SYS = 1 case, but still necessary in PPP. I think this puts PPP more in line with the rest of the lwIP core. * Added ppp_poll(pd) function, which needs to be called periodically when in single-threaded mode.
This all seems to work fine so far. I wonder though, how to make this working again in a multi-threaded environment, where we have a separate thread to poll the serial for input. I guess the PPP input and output paths are not thread-safe, so they would have to be synchronized in some way. The current approach with calling tcpip_callback() all the time does not look like the right way to me.
Is anyone interested on collaborating on this? I've heard from quite a few guys now, who did their own hacks to get PPP working in a single-threaded environment, and I think it's time to get it right. Any input is welcome!
|[Prev in Thread]||Current Thread||[Next in Thread]|