buglwIP - A Lightweight TCP/IP stack - Bugs: bug #52856, Make Socket API usable without...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #52856: Make Socket API usable without thread support.

Submitter:  Matthias Hofmann <mhofmann>
Submitted:  Wed 10 Jan 2018 11:00:19 AM UTC
   
 
Category:  sockets/netconn Severity:  3 - Normal
Item Group:  Feature Request Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  2.1.0
lwIP version:  2.0.3

Thu 11 Jan 2018 09:10:32 AM UTC, comment #4: 

Should work now.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 10 Jan 2018 02:45:24 PM UTC, comment #3: 

Right. I'll work on that. A cleanup moving sys_timeouts_mbox_fetch() to tcpip.c is pending anyway... That will make sys_check_timeouts() global.

Simon Goldschmidt <goldsimon>
Group administrator
Wed 10 Jan 2018 02:28:21 PM UTC, comment #2: 

The tcpip_thread_poll_one() function goes in the desired direction. But the timeout check function sys_check_timeouts() is still not accessible. Defining LWIP_TESTMODE would solve this problem, but activating a test mode for regular usage does not feel good.

It would be nice if tcpip_thread_poll_one() and sys_check_timeouts() can be used without activating any test/debug modes.

Matthias Hofmann <mhofmann>
Wed 10 Jan 2018 12:07:02 PM UTC, comment #1: 

Can you check current git master? I'm doing the same thing to implement socks unit tests, see test/unit/...

Simon Goldschmidt <goldsimon>
Group administrator
Wed 10 Jan 2018 11:00:19 AM UTC, original submission:  

We are using lwIP in our real time OS with static tasks and hard deadlines. Initial we used lwIP with NO_SYS=1, but the effort to use 3rd party libs on top of the callback API of lwIP was quite high.

So we decided to use the Socket API provided by lwIP. This means implementing the mailbox system, mutex and semaphores (NO_SYS=0). But still the Socket API can not be used in a real time environment.
For adding this support only some modifications in lwIP are needed. The main problem is the tcpip_thread() function, that never return and it mainly boils down to make it cyclic callable.

In our solution the sys_thread_new() function in sys_arch.c is a NOP and tcpip_thread() and sys_check_timeouts() are called cyclic.

In the end we have a working solution, that allow us to use the non blocking part of the socket API.

The attached example contains all modification we did inside of lwIP. It is no clean solution. I attached it. So you can get an impression, which modifications are needed.

The question is: If there is any interest in making the Socket API available for real time systems and environments without support for concurrent threads?

Cheers Matthias

Matthias Hofmann <mhofmann>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by mhofmann (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-01-11 goldsimon StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2018-01-10 goldsimon StatusNone Confirmed
        Assigned toNone goldsimon
        Planned ReleaseNone 2.1.0
    2018-01-10 mhofmann Attached File- Added example_0001-Make-tcpip_thread-cyclic-callable.patch, #42882

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code