lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [task #6683] Document lwIPs thread safety requirements


From: Simon Goldschmidt
Subject: [lwip-devel] [task #6683] Document lwIPs thread safety requirements
Date: Mon, 16 Apr 2007 11:09:56 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3

Follow-up Comment #6, task #6683 (project lwip):

Kieran,

as a summary for lwIP's protection against concurrent access / multithreading
protection, I would like to summarize it like this:

First, there are 3 different scenarios:
1) Raw-API only (NO_SYS=1), no access to lwIP functions from interrupt
context, network interfaces are polled --> no protection needed!
2) Raw-API only (NO_SYS=1), network interfaces work with interrupts (->
interrupt context accesses pbuf.c...) --> LIGHTWEIGHT_PROT needed to protect
pbuf pool / memp / mem.c heap **
3) complete multithreaded environment (NO_SYS=0)

** mem.c protection: what if TX-done-interrupt frees a PBUF_RAM?

- The difference between 1) and 2) is only the mode of the network-driver.
- With 2) & 3), required protection is the same.
- lwIP core is not thread-safe. In multithreading environment, threads other
than the main lwIP thread (tcpip_thread()) only may use functions defined in
sys.h, api.h, sockets.h,  mem.h, memp.h and pbuf.h.


I think that's about it, any comments are welcome! We still need to clarify
if my interpretations of NO_SYS are correct and if we need a
SYS_HEAVYWEIGHT_PROT or something (I think we don't and thus, should rename
SYS_LIGHTWEIGHT_PROT to SYS_PROT or something).

Then, we could inlcude those three forms in a contrib module somewhere (unix
port should be best as it seems the most used...).

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?6683>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/





reply via email to

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