[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #52856] Make Socket API usable without thread support.

From: Matthias Hofmann
Subject: [lwip-devel] [bug #52856] Make Socket API usable without thread support.
Date: Wed, 10 Jan 2018 06:00:21 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0


                 Summary: Make Socket API usable without thread support.
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: mhofmann
            Submitted on: Wed 10 Jan 2018 11:00:19 AM UTC
                Category: sockets/netconn
                Severity: 3 - Normal
              Item Group: Feature Request
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: 2.0.3



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

Cheers Matthias


File Attachments:

Date: Wed 10 Jan 2018 11:00:19 AM UTC  Name:
example_0001-Make-tcpip_thread-cyclic-callable.patch  Size: 4KiB   By:



Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]