lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Multiple servers under LwIP


From: Robert Deschambault
Subject: Re: [lwip-users] Multiple servers under LwIP
Date: Sat, 7 Feb 2015 11:30:28 -0500

I am very sure you are right!  I will review my code to make sure I am compliant with the lwIP threading model as you describe.  I will let you know how it goes.

Thanks!
Bob

On Sat, Feb 7, 2015 at 11:26 AM, Sylvain Rochet <address@hidden> wrote:
Hello Robert,

On Sat, Feb 07, 2015 at 10:18:29AM -0500, Robert Deschambault wrote:
> Hi,
>
> I am using the latest sources from the master branch and I am running on a
> STM32F429 under CMSIS-RTOS/RTX.  I am putting together a framework for our
> application that includes multiple servers each running in its own thread.
>
> I have written and tested the code for each server individually and they
> work fine.  They are essentially a UDP server and a TCP server that
> responds to messages from the client to request small packets of
> information.  They are running on different ports.  However, when I try to
> run both servers in my framework my TCP server seems to stop responding to
> requests after I have done a UDP request.  I am fairly new to LwIP, can
> anyone guide me as to what might be happening and why I can run each server
> ok but they can't seem to run together at the same time?

As usual, it looks like a broken port or usage which do not follow lwIP
threading model.

Summary:

- Do *NOT* call anything in interrupt context, nothing, never, never,
use your OS semaphore signaling to an Ethernet/serial/… RX thread
- memp_* functions are thread-safe if SYS_LIGHTWEIGHT_PROT is
set, and again, thread safe does not mean it is interrupt safe, especially
if your hardware does nested interrupts
- Do *NOT* call any function from the RAW API outside lwIP thread
- Use Netconn or Socket API in others threads, but keep in mind you
should not share a Netconn/Socket control block between threads, (or use
proper locking if you really have to, of course).


I should really add a hook in my MUA to answer that :-)

Sylvain

_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users



--
Bob Deschambault
6614 Astro Court, Mississauga
Ontario, Canada L5N 7J2
home: 905 824 7159
cell: 416 457 7163
twitter: @rdeschambault
1Fm3QkinyqiMbpnvSZMLM1AyjBvbuYeTBE

reply via email to

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