lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Recommendations needed for API design


From: Marcus Bäckman
Subject: [lwip-users] Recommendations needed for API design
Date: Fri, 19 Feb 2010 15:02:58 +0100

Hello,
 
I am currently porting lwip for our ppc hardware, and have so far succesfully been using the raw TCP API.
The requirements for the application interface is a socket interface without the blocking functionality and I have some questions regarding its design.
 
The stack will be running in a mulithreaded environment with certain restrictions, for example: only one thread a time will use a certain socket at a time.
I would prefer not to have any dependency towards the operating system, and the approach is to make further restrictions on the application to guarantee safe multithreaded usage.
 
Here is my thoughts of the general approach:
- Each socket has a dedicated area for buffering incoming pbuf's.
- Transmission data will be queued and handled in a seperate thread which transmits pending data and processes incoming data.
 
What are your thoughts on this approach? Would it be easier you just abandon it in favor for the current socket/netconn API ?
 
Is it multithread safe to use pbuf_free() on a pbufs (PBUF_RAW from PBUF_POOL) from one context, and in another context use pbuf_alloc() (PBUF_RAW)?
 
Regards,
Marcus
 

reply via email to

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