[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Is it possible to use LwIP Netconn API on an RTOS witho
Re: [lwip-users] Is it possible to use LwIP Netconn API on an RTOS without semaphore and mutex supported?
Wed, 29 Jul 2020 07:54:23 +0200
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0
Am 27.07.2020 um 14:15 schrieb yanhc519 via lwip-users:
> Hi all.
> I have an RTOS which is a little strange. The RTOS can handle
> multi-tasking and message queues, but can not handle semaphore and mutex.
> I want to use the Netconn API on my RTOS. Is it possible?
Honestly, I don't know. But I don't think so. It's certainly not been
designed for that. But if you ensure to not compile/link the functions
using the mutex, you should find out fast, no?
However, it should not be too difficult to implement your own semaphore
by using a message queue. Mutex could be harder, but using a binary
semaphore works as well (although you could get priority inversion).
> Firstly, I am using memory pools instead of memory heap, so
> the sys_mutex_lock(&mem_mutex); in mem.c can be excluded.
> Secondly, I have set LWIP_TCPIP_CORE_LOCKING_INPUT to 0, so the input
> packet is passed to the core via tcpip_mbox. I have also
> set LWIP_TCPIP_CORE_LOCKING to 0, so the TCPIP_MSG_API is passed to the
> core via tcpip_mbox. Is this enough?
> I have noticed that tcpip_send_msg_wait_sem() in tcpip.c uses
> sys_arch_sem_wait(sem, 0). And this is unable to exclude. Does this mean
> that Netconn API always use a semaphore and my plan cannot be feasible?
> Thanks in advance.
> lwip-users mailing list