|
From: | Simon Goldschmidt |
Subject: | Re: [lwip-users] lwIP and threads |
Date: | Wed, 23 Jan 2013 17:54:58 +0100 |
LwIP doesn't really support threads. Instead, in threaded mode, lwIP runs in one dedicated thread (often called the tcpip_thread, based on the thread loop function). All packet processing is done in this thread. Raw API callbacks are done in this thread, too. The only things that are allowed outside of this thread are: A) allocating pbufs (from the driver) B) calling thread-safe functions of the API layer (e.g. Netconn API, sockets, etc.) When not using the netconn or socket API, you can implement the main loop running in its dedicated thread yourself, but it might be easier to use the existing code and implement a sys adaption layer. Also, be aware that you must not call timer functions or input packet processing from an ISR or another thread! Simon
|
[Prev in Thread] | Current Thread | [Next in Thread] |