lwIP - A Lightweight TCP/IP stack - Bugs: bug #1902, Timeouts and semaphores/mailboxes...
You are not allowed to post comments on this tracker with your current authentication level.
bug #1902: Timeouts and semaphores/mailboxes are too tightly integrated
Submitter: | Kieran Mansley <kieranm> | ||
Submitted: | Thu 05 Dec 2002 10:33:05 AM UTC | ||
Category: | None | Severity: | 1 - Wish |
Item Group: | None | Status: | Invalid |
Privacy: | Public | Assigned to: | None |
Open/Closed: | Closed | Planned Release: | None |
lwIP version: | None |
Jump to the original submission
Thu 23 Aug 2007 06:18:56 AM UTC, comment #43: |
Simon Goldschmidt <goldsimon> |
Wed 22 Aug 2007 10:42:05 PM UTC, comment #42: Simon, can we close it (about coment #41) ? |
Frédéric Bernon <fbernon> |
Fri 13 Jul 2007 11:59:36 AM UTC, comment #41: I think those issues should be raised as separate bugs so that we can track them independently. Simon: could you do that, and then close this one? |
Kieran Mansley <kieranm> |
Fri 15 Jun 2007 12:02:00 PM UTC, comment #40: Now that I think about it:
|
Simon Goldschmidt <goldsimon> |
Fri 15 Jun 2007 09:16:41 AM UTC, comment #39: If everyone else is happy, it's OK with me to close this. |
Kieran Mansley <kieranm> |
Sat 09 Jun 2007 10:19:14 AM UTC, comment #38: Kieran, you have open it. Are you agree to close it?
|
Frédéric Bernon <fbernon> |
Sat 02 Jun 2007 10:37:16 AM UTC, comment #37: I think so, yes. |
Simon Goldschmidt <goldsimon> |
Sat 02 Jun 2007 10:23:00 AM UTC, comment #36: Can we close that? |
Frédéric Bernon <fbernon> |
Tue 22 May 2007 08:54:41 PM UTC, comment #35: Ok, it's check in...
|
Frédéric Bernon <fbernon> |
Tue 22 May 2007 02:38:37 PM UTC, comment #34: So you remove sys_mbox_fetch_timeout() (was only used for LWIP_SO_RCVTIMEO) and use sys_arch_mbox_fetch() instead of sys_mbox_fetch() in api files?
|
Simon Goldschmidt <goldsimon> |
Tue 22 May 2007 01:34:50 PM UTC, comment #33: So (and because in forum's thread "lwIP Manual", we have decide to try to do all the port-breakage modifications only in the next release, because there is already some others port-breakages) I propose to check in the patch file attached. If no objects, I will add an information in CHANGELOG and sys_arch.txt to remember that users doesn't have to use lwIP internal features in their application level.
|
Frédéric Bernon <fbernon> |
Mon 21 May 2007 05:06:19 PM UTC, comment #32: Silence == tacit agreement. :-) |
Frédéric Bernon <fbernon> |
Mon 21 May 2007 04:43:32 PM UTC, comment #31: I don't think there's a problem with that, but I can't be sure - there might be some reasonable situation where someone may want to use the sys API from their own application. Perhaps change it and see who screams ;-). |
Jonathan Larmour <jifl> |
Mon 21 May 2007 04:41:53 PM UTC, comment #30: You want to replace calls to sys_mbox_post() by calls to sys_arch_mbox_fetch() ???
|
Simon Goldschmidt <goldsimon> |
Mon 21 May 2007 04:35:19 PM UTC, comment #29: No comment about previous remark (comment #28) ? Can I propose a patch file for that?
|
Frédéric Bernon <fbernon> |
Wed 16 May 2007 01:01:24 PM UTC, comment #28:
|
Frédéric Bernon <fbernon> |
Wed 16 May 2007 12:50:55 PM UTC, comment #27: I'm agree with you about opening a new "patch" for the timestamp timer changes. Because some new features can be shared to replace the snmp timer (see https://savannah.nongnu.org/patch/?5785), I think the title should have to be something like "Integration of ticks & jiffies in timers"...
|
Frédéric Bernon <fbernon> |
Wed 16 May 2007 11:27:15 AM UTC, comment #26: OK, what I'm saying is:
|
Simon Goldschmidt <goldsimon> |
Wed 16 May 2007 11:21:38 AM UTC, comment #25: I'm not sure I understand the significance of what you're getting at (I'm not up to speed on the nitty-gritty of this one) but I wouldn't worry too much about breaking things in contrib - a lot of them are already out of date, and are going to be archived, and anything that isn't will have an active maintainer to deal with things like this. |
Kieran Mansley <kieranm> |
Wed 16 May 2007 11:16:32 AM UTC, comment #24: Oh, what I forgot: :-)
|
Simon Goldschmidt <goldsimon> |
Wed 16 May 2007 11:14:18 AM UTC, comment #23: Kieran, as at least one implementation in contrib relies on the integration of timers with semaphores and tcpip.c relies on it with mboxes, maybe we see this as a feature instead of a bug?
|
Simon Goldschmidt <goldsimon> |
Sun 13 May 2007 01:13:56 PM UTC, comment #22:
|
Simon Goldschmidt <goldsimon> |
Sun 13 May 2007 10:01:27 AM UTC, comment #21: OK, I've had a little time to create a new version of sys.h/sys.c (attaching the 2 new files instead of a patch) with the following changes to the original sys layer:
|
Simon Goldschmidt <goldsimon> |
Fri 27 Apr 2007 06:18:09 AM UTC, comment #20:
|
Simon Goldschmidt <goldsimon> |
Fri 27 Apr 2007 12:39:35 AM UTC, comment #19: Agreed on pretty much everything. I'm not sure you need OS specific constants for "wait infinite" and "poll" though - instead give the functions different names, and if the port wants to map that to the same underlying function with special arguments, then it can do that with a #define.
|
Jonathan Larmour <jifl> |
Thu 26 Apr 2007 07:04:34 PM UTC, comment #18: OK, dealing with jiffies only in the stack would improve performance, I think. Since most OSes use them also in their semaphore and mailbox wait functions, we could also modify the sys_arch_sem_* and sys_arch_mbox_* functions eliminating the conversion from ms to jiffies in those functions as well.
|
Simon Goldschmidt <goldsimon> |
Mon 23 Apr 2007 11:49:17 AM UTC, comment #17: I haven't looked in detail either (although it would be nice if someone could!) but this definitely sounds like a step in the right direction. Thanks for putting in the effort on this. |
Kieran Mansley <kieranm> |
Sat 21 Apr 2007 02:04:42 AM UTC, comment #16: I haven't looked at the patch itself yet, but a comment or two based on the description. Rather than a single SYS_ARCH_TICKS_PER_SECOND constant , I think it would be nice for the port to provide macro functions:
|
Jonathan Larmour <jifl> |
Fri 20 Apr 2007 09:27:09 PM UTC, comment #15: Finally... I've put together a first patch introducing new timers using timestamps. This solves only semaphore/timer integration, as timer-callbacks are still called inside sys_mbox_fetch() which is a good implementation, I think (as it saves us from locking as opposed to calling timeout handlers from interrupt context). In places where this is not wanted, sys_arch_mbox_fetch(mbox, msg, 0) can directly be called.
|
Simon Goldschmidt <goldsimon> |
Wed 11 Apr 2007 02:43:26 PM UTC, comment #14:
|
Jonathan Larmour <jifl> |
Wed 11 Apr 2007 07:51:18 AM UTC, comment #13: Who me? I've been avoiding the whole timeouts issue recently as to be honest I don't fully understand the problem enough to be able to give strong opinions as to what to do, and haven't had time to bring myself up to speed.
|
Kieran Mansley <kieranm> |
Wed 11 Apr 2007 07:04:25 AM UTC, comment #12:
|
Simon Goldschmidt <goldsimon> |
Wed 11 Apr 2007 02:05:41 AM UTC, comment #11: I think most systems use free-running timers for clocks where possible. I think you have to assume the OS clock is accurate - what else can you do!
|
Jonathan Larmour <jifl> |
Fri 09 Mar 2007 06:00:37 PM UTC, comment #10:
|
Simon Goldschmidt <goldsimon> |
Fri 09 Mar 2007 02:09:20 PM UTC, comment #9: I fully agree. Easy porting should definately be one of lwIP's goals. It is kind of nice that just porting semaphores and mailboxes gives timer functionality for free (and you also get this ginsu knife for absolutely no cost at all ;-). Plus the timestamp stuff has less processing overhead than hooking to the tick timer.
|
Atte Kojo <kojo> |
Fri 09 Mar 2007 01:47:30 PM UTC, comment #8: Even IF developing version 2, it would require a system where you can hook on the timer tick and that would have to be accurate.
|
Simon Goldschmidt <goldsimon> |
Fri 09 Mar 2007 01:28:42 PM UTC, comment #7: Dmitry:
|
Atte Kojo <kojo> |
Fri 09 Mar 2007 12:01:22 PM UTC, comment #6:
|
Simon Goldschmidt <goldsimon> |
Fri 09 Mar 2007 11:15:43 AM UTC, comment #5: Atte:
You are right, it is not... So, perhaps, we should replace sys_mbox_fetch with sys_arch_mbox_fetch in api_lib.c to make the code more simple, but I would like to know what others think before making any changes here.
|
Dmitry Potapov <dpotapov> |
Fri 09 Mar 2007 09:55:00 AM UTC, comment #4: I agree with Frédéric on removing sys_timeout stuff entirely from user-side functions. Simply calling sys_arch_mbox_fetch and sys_sem_wait suffices for user-side timeouts.
|
Atte Kojo <kojo> |
Fri 09 Mar 2007 09:24:45 AM UTC, comment #3: Hi, agree with you.
|
Frédéric Bernon <fbernon> |
Fri 09 Mar 2007 08:27:16 AM UTC, comment #2: I think this is still a major issue. To solve it means quite a big change in implementation of the sys layer. Because of this, I'd like comments from lwip_users, also.
|
Simon Goldschmidt <goldsimon> |
Tue 04 Jul 2006 11:45:22 AM UTC, comment #1: A proper portable timer solution would be nice replacement for sys_timout(). sys_timeout() seems to give erratic / random results with the sequential API, I'm only guessing what's going wrong there. I think we should keep timeouts for mailboxes for the purpose of polling a mailbox without blocking the thread.
|
Christiaan Simons <christiaans> |
Thu 05 Dec 2002 10:33:05 AM UTC, original submission:
The current implementation of lwIP has implements both of these functions as one. A number of people have found this to be too restrictive for their needs and would prefer to see a separation of the two. |
Kieran Mansley <kieranm> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 9 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2007-08-23 | goldsimon | Status | None | Invalid | |
Open/Closed | Open | Closed | |||
2007-05-22 | fbernon | Attached File | - | Added sys.c.patch, #12830 | |
2007-05-13 | goldsimon | Attached File | - | Added sys.c, #12761 | |
Attached File | - | Added sys.h, #12762 | |||
2007-04-20 | goldsimon | Attached File | - | Added newtimers1.patch, #12539 | |
2007-03-09 | kojo | Carbon-Copy | Removed 51921 | - | |
2007-03-09 | kojo | Carbon-Copy | Removed 51921 | - | |
2007-03-09 | kojo | Carbon-Copy | Removed 51921 | - |
Powered by Savane 3.13-caa5.
Corresponding source code
I've opened task #7235 for the NO_SYS=1 issue. The core locking issue is far far away, I've put a statement about this in task #6994.