|
From: | Peter Graf |
Subject: | Re: [lwip-users] sys_timeout |
Date: | Wed, 08 Mar 2006 09:46:47 +0100 |
User-agent: | Mozilla Thunderbird 1.0 (Windows/20041206) |
Hi Curt,
I see what you and Derek are getting at, with sys_timeout being used only by lwip and i/f threads. But I still fail to see why it should be in src/core instead of cleanly separated, and implemented this way especially if it results in inelegant code and common misunderstandings.
As long as one uses the given interfaces, and doesn't deal with the internals, there is little misunderstanding here. I would not propose a re-structuring of the code because there is little benefit and a risk of breaking essentials, especially the common usage of lwIP for both multitasking and RAW API.
Suppose I want to implement timeouts using a hardware timer interrupt? Or suppose I want them to be handled by a separate thread? Or suppose I want to implement them as a setitimer and SIGALRM? I'm out of luck?
You just don't implement the timeouts, you implement "semaphores with timeout" as required by lwIP. This is the given interface for a multitasking O/S, and nobody keeps you from implementing them with whatever means you like.
I'm actually not using tcpip_thread() or any of the src/api, but rather the "raw" API (I'm precluded from using netconn since its message passing is based on shared memory). My O/S also does not have semaphores. It has nothing but timer interrupts, network interface interrupts, and bus interrupts. I define NO_SYS.
From your previous postings, e.g. about semaphores, I concluded that you intend to use the multitasking API. The RAW API is a totally different issue.
Peter
[Prev in Thread] | Current Thread | [Next in Thread] |