Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-18 Thread Svante Signell
On Fri, 2013-02-15 at 19:59 +0100, Samuel Thibault wrote: Svante Signell, le Fri 15 Feb 2013 10:54:44 +0100, a écrit : So it's ii-1 whose array position gets _hurd_port_free()d. array position ii does *not* get _hurd_port_free()d, while /* If one descriptor is bogus, mark

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-18 Thread Samuel Thibault
Svante Signell, le Mon 18 Feb 2013 17:13:10 +0100, a écrit : This does _hurd_port_free() array position ii, even if it is actually undefined since _hurd_port_get returning MACH_PORT_NULL means it didn't work (and thus didn't fill the array position). So the correct change would be to

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-15 Thread Svante Signell
On Fri, 2013-02-15 at 02:05 +0100, Samuel Thibault wrote: BTW, I can understand the kind of frustration you can have of seeing your work being thrown away and rewritten. Well, that's life, software is a lot about frustration, you'll have to get a thick head. As I said, it's no big deal from

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-15 Thread Svante Signell
On Fri, 2013-02-15 at 09:53 +0100, Samuel Thibault wrote: Svante Signell, le Fri 15 Feb 2013 08:39:39 +0100, a écrit : On Fri, 2013-02-15 at 00:31 +0100, Samuel Thibault wrote: Svante Signell, le Fri 15 Feb 2013 00:18:16 +0100, a écrit : I don't understand what you mean. What delay

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-15 Thread Svante Signell
On Fri, 2013-02-15 at 00:58 +0100, Samuel Thibault wrote: Svante Signell, le Fri 15 Feb 2013 00:37:39 +0100, a écrit : No, it doesn't. There are quite a few ways in which it will break. if (d[i].io_port == MACH_PORT_NULL) {

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-15 Thread Samuel Thibault
Svante Signell, le Fri 15 Feb 2013 10:32:26 +0100, a écrit : On Fri, 2013-02-15 at 09:53 +0100, Samuel Thibault wrote: Svante Signell, le Fri 15 Feb 2013 08:39:39 +0100, a écrit : On Fri, 2013-02-15 at 00:31 +0100, Samuel Thibault wrote: Svante Signell, le Fri 15 Feb 2013 00:18:16 +0100,

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-15 Thread Samuel Thibault
Svante Signell, le Fri 15 Feb 2013 10:54:44 +0100, a écrit : I did understand the code, but maybe the change went wrong. I would really appreciate if you could help me to understand what's the problem with the new code. Old code: (cleaning previously allocated ports when one FD is bogus and

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-15 Thread Samuel Thibault
Svante Signell, le Fri 15 Feb 2013 08:25:59 +0100, a écrit : The mail has an RFC in the title. I did not claim that the rewrite was completed, did I? Yes, but for this kind of very complex code, it was way faster to just rewrite the thing than go through a review/fix ping-pong which would have

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-14 Thread Samuel Thibault
Svante Signell, le Wed 13 Feb 2013 07:24:46 +0100, a écrit : Problem is that he did not give any hints on _how_ to make the rewrite. If introducing the SELECT_ERROR had been discussed (or allowed to introduce) my solution would have been different too. As I mentioned yesterday, I couldn't have

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-14 Thread Svante Signell
On Thu, 2013-02-14 at 23:49 +0100, Samuel Thibault wrote: Svante Signell, le Wed 13 Feb 2013 07:24:46 +0100, a écrit : Problem is that he did not give any hints on _how_ to make the rewrite. If introducing the SELECT_ERROR had been discussed (or allowed to introduce) my solution would have

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-14 Thread Samuel Thibault
Svante Signell, le Fri 15 Feb 2013 00:18:16 +0100, a écrit : Well, I might say I have some C programming experience some is not enough to properly deal with something as complex as select :) Svante Signell, le Wed 13 Feb 2013 06:51:29 +0100, a écrit : On Wed, 2013-02-13 at 01:53 +0100,

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-14 Thread Svante Signell
On Fri, 2013-02-15 at 00:31 +0100, Samuel Thibault wrote: Having a separate hurddoselect.c with a function containing the shared code would have both factorization and hierarchy, but the semantic of the function gets tricky, and it'd be easy to miss thing. Select/poll *are* complex, you

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-14 Thread Samuel Thibault
Svante Signell, le Fri 15 Feb 2013 00:37:39 +0100, a écrit : No, it doesn't. There are quite a few ways in which it will break. Well (as you say) I'm a newbie C programmer, tell me where the bugs are ;-) As I already said, there are too many than I want to even spend time describing any.

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-14 Thread Samuel Thibault
BTW, I can understand the kind of frustration you can have of seeing your work being thrown away and rewritten. Well, that's life, software is a lot about frustration, you'll have to get a thick head. Samuel

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-14 Thread Svante Signell
On Fri, 2013-02-15 at 00:58 +0100, Samuel Thibault wrote: Svante Signell, le Fri 15 Feb 2013 00:37:39 +0100, a écrit : No, it doesn't. There are quite a few ways in which it will break. Well (as you say) I'm a newbie C programmer, tell me where the bugs are ;-) As I already said,

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-14 Thread Svante Signell
On Fri, 2013-02-15 at 00:31 +0100, Samuel Thibault wrote: Svante Signell, le Fri 15 Feb 2013 00:18:16 +0100, a écrit : I don't understand what you mean. What delay are you talking about? The only delay in by branch is the delay requested by the user. Well, with my code I need a

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-13 Thread Svante Signell
On Wed, 2013-02-13 at 08:46 +0100, Richard Braun wrote: On Wed, Feb 13, 2013 at 07:24:46AM +0100, Svante Signell wrote: We warned you several times about making your changes as little intrusive as possible for easier review. Since you seem to be unable to understand what that implies,

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-13 Thread Svante Signell
On Wed, 2013-02-13 at 09:07 +0100, Richard Braun wrote: On Wed, Feb 13, 2013 at 06:51:29AM +0100, Svante Signell wrote: - the rewritten code is faster than the old one. In the old code no delay is needed for the POLL case but is for the rewritten code. i.e. it's faster. (irrespective of

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-13 Thread Samuel Thibault
(I will reply on the other items this evening) Svante Signell, le Wed 13 Feb 2013 06:51:29 +0100, a écrit : - you cannot commit this code unless I agree to sign the copyright papers for libc (which I of course will when asked for). This is a derived work of mine. Otherwise it has to stay as a

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-13 Thread Richard Braun
On Wed, Feb 13, 2013 at 06:51:29AM +0100, Svante Signell wrote: - the rewritten code is faster than the old one. In the old code no delay is needed for the POLL case but is for the rewritten code. i.e. it's faster. (irrespective of moving timeouts to the server side or not) I highly doubt it

Re: [PATCH, HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-13 Thread Ivan Shmakov
Svante Signell svante.sign...@gmail.com writes: On Wed, 2013-02-13 at 09:07 +0100, Richard Braun wrote: On Wed, Feb 13, 2013 at 06:51:29AM +0100, Svante Signell wrote: […] - you cannot commit this code unless I agree to sign the copyright papers for libc (which I of course will when asked

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-13 Thread Svante Signell
On Wed, 2013-02-13 at 09:32 +0100, Samuel Thibault wrote: (I will reply on the other items this evening) Svante Signell, le Wed 13 Feb 2013 06:51:29 +0100, a écrit : - you cannot commit this code unless I agree to sign the copyright papers for libc (which I of course will when asked for).

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-13 Thread Samuel Thibault
Svante Signell, le Wed 13 Feb 2013 10:22:37 +0100, a écrit : On Wed, 2013-02-13 at 09:32 +0100, Samuel Thibault wrote: (I will reply on the other items this evening) Svante Signell, le Wed 13 Feb 2013 06:51:29 +0100, a écrit : - you cannot commit this code unless I agree to sign the

Re: [PATCH, HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-13 Thread Svante Signell
On Wed, 2013-02-13 at 09:29 +, Ivan Shmakov wrote: Svante Signell svante.sign...@gmail.com writes: On Wed, 2013-02-13 at 09:07 +0100, Richard Braun wrote: On Wed, Feb 13, 2013 at 06:51:29AM +0100, Svante Signell wrote: […] - you cannot commit this code unless I agree to sign the

Re: [PATCH, HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-13 Thread Samuel Thibault
Samuel Thibault, le Wed 13 Feb 2013 10:45:56 +0100, a écrit : here, in the rewritten version even the algorithm itself is completely different. Which was actually the whole motivation for the rewrite, rather than basing on the available implementation. Samuel

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-13 Thread Svante Signell
On Wed, 2013-02-13 at 10:38 +0100, Samuel Thibault wrote: Svante Signell, le Wed 13 Feb 2013 10:22:37 +0100, a écrit : On Wed, 2013-02-13 at 09:32 +0100, Samuel Thibault wrote: Anyway, until next time no copyright assignment is needed... If you consider working on libc again (and actually

Re: [PATCH, HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-13 Thread Thomas Schwinge
Hi! On Wed, 13 Feb 2013 10:48:13 +0100, Svante Signell svante.sign...@gmail.com wrote: On Wed, 2013-02-13 at 10:38 +0100, Samuel Thibault wrote: If you consider working on libc again (and actually it's also true for hurd and gnumach), you should probably still assign copyright already, so

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Svante Signell
On Tue, 2013-02-12 at 00:40 +0100, Svante Signell wrote: On Thu, 2013-01-24 at 13:58 +0100, Svante Signell wrote: Ok, here is the not yet complete patch for hurdselect.c. An explanation will follow tomorrow, too late to get everything written down correctly now. The patch is longer than the

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Samuel Thibault
Svante Signell, le Tue 12 Feb 2013 09:09:25 +0100, a écrit : Attached is a patch wrt the latest patch (step2) on January 24 2013. The indentation is different, therefore the diff blocks are a little large (but easier to read). Hopefully this is better. Including also the resulting file

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Svante Signell
On Tue, 2013-02-12 at 22:55 +0100, Samuel Thibault wrote: Svante Signell, le Tue 12 Feb 2013 09:09:25 +0100, a écrit : Attached is a patch wrt the latest patch (step2) on January 24 2013. The indentation is different, therefore the diff blocks are a little large (but easier to read).

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Samuel Thibault
Svante Signell, le Tue 12 Feb 2013 23:46:00 +0100, a écrit : - some minor tweaks will still be made to be mor POSIX consistent. It'd be way better to keep these as separate patches. That's how we'll have to submit them to libc-alpha anyway... Samuel

Re: [PATCH, HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Pino Toscano
Alle martedì 12 febbraio 2013, Svante Signell ha scritto: * change the FD_SETSIZE upper value check to larger than or equal from larger than. (from POSIX definition of select: http://pubs.opengroup.org/onlinepubs/009604499/functions/select.html ) It's

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Svante Signell
On Tue, 2013-02-12 at 23:50 +0100, Samuel Thibault wrote: Svante Signell, le Tue 12 Feb 2013 23:46:00 +0100, a écrit : - some minor tweaks will still be made to be mor POSIX consistent. It'd be way better to keep these as separate patches. That's how we'll have to submit them to libc-alpha

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Samuel Thibault
Svante Signell, le Tue 12 Feb 2013 23:55:04 +0100, a écrit : On Tue, 2013-02-12 at 23:50 +0100, Samuel Thibault wrote: Svante Signell, le Tue 12 Feb 2013 23:46:00 +0100, a écrit : - some minor tweaks will still be made to be mor POSIX consistent. It'd be way better to keep these as

Re: [PATCH, HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Svante Signell
On Tue, 2013-02-12 at 23:52 +0100, Pino Toscano wrote: Alle martedì 12 febbraio 2013, Svante Signell ha scritto: * change the FD_SETSIZE upper value check to larger than or equal from larger than. (from POSIX definition of select:

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Svante Signell
On Wed, 2013-02-13 at 00:03 +0100, Samuel Thibault wrote: Svante Signell, le Tue 12 Feb 2013 23:55:04 +0100, a écrit : On Tue, 2013-02-12 at 23:50 +0100, Samuel Thibault wrote: Svante Signell, le Tue 12 Feb 2013 23:46:00 +0100, a écrit : - some minor tweaks will still be made to be mor

Re: [PATCH, HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Samuel Thibault
Svante Signell, le Wed 13 Feb 2013 00:04:33 +0100, a écrit : Then you have to convince the Linux man page and the python3.2 developers too. From python3.2: ./Include/fileobject.h: #define _PyIsSelectable_fd(FD) (((FD) = 0) ((FD) FD_SETSIZE)) That's easy: point them to the latest version of

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Samuel Thibault
Svante Signell, le Wed 13 Feb 2013 00:06:10 +0100, a écrit : On Wed, 2013-02-13 at 00:03 +0100, Samuel Thibault wrote: Svante Signell, le Tue 12 Feb 2013 23:55:04 +0100, a écrit : On Tue, 2013-02-12 at 23:50 +0100, Samuel Thibault wrote: Svante Signell, le Tue 12 Feb 2013 23:46:00 +0100,

Re: [PATCH, HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Pino Toscano
Alle mercoledì 13 febbraio 2013, Svante Signell ha scritto: On Tue, 2013-02-12 at 23:52 +0100, Pino Toscano wrote: Alle martedì 12 febbraio 2013, Svante Signell ha scritto: * change the FD_SETSIZE upper value check to larger than or equal from larger than. (from POSIX

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Svante Signell
On Wed, 2013-02-13 at 00:07 +0100, Samuel Thibault wrote: Svante Signell, le Wed 13 Feb 2013 00:06:10 +0100, a écrit : On Wed, 2013-02-13 at 00:03 +0100, Samuel Thibault wrote: Svante Signell, le Tue 12 Feb 2013 23:55:04 +0100, a écrit : On Tue, 2013-02-12 at 23:50 +0100, Samuel Thibault

Re: [PATCH, HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Samuel Thibault
Pino Toscano, le Wed 13 Feb 2013 00:08:21 +0100, a écrit : Alle mercoledì 13 febbraio 2013, Svante Signell ha scritto: On Tue, 2013-02-12 at 23:52 +0100, Pino Toscano wrote: Alle martedì 12 febbraio 2013, Svante Signell ha scritto: * change the FD_SETSIZE upper value check to larger

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Samuel Thibault
Svante Signell, le Wed 13 Feb 2013 00:12:57 +0100, a écrit : On Wed, 2013-02-13 at 00:07 +0100, Samuel Thibault wrote: Svante Signell, le Wed 13 Feb 2013 00:06:10 +0100, a écrit : On Wed, 2013-02-13 at 00:03 +0100, Samuel Thibault wrote: Svante Signell, le Tue 12 Feb 2013 23:55:04 +0100,

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Richard Braun
On Tue, Feb 12, 2013 at 11:50:21PM +0100, Samuel Thibault wrote: Svante Signell, le Tue 12 Feb 2013 23:46:00 +0100, a écrit : - some minor tweaks will still be made to be mor POSIX consistent. It'd be way better to keep these as separate patches. That's how we'll have to submit them to

Re: [PATCH, HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Svante Signell
On Wed, 2013-02-13 at 00:08 +0100, Pino Toscano wrote: Alle mercoledì 13 febbraio 2013, Svante Signell ha scritto: On Tue, 2013-02-12 at 23:52 +0100, Pino Toscano wrote: Alle martedì 12 febbraio 2013, Svante Signell ha scritto: * change the FD_SETSIZE upper value check to larger than or

Re: [PATCH, HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Pino Toscano
Alle mercoledì 13 febbraio 2013, Samuel Thibault ha scritto: Pino Toscano, le Wed 13 Feb 2013 00:08:21 +0100, a écrit : Alle mercoledì 13 febbraio 2013, Svante Signell ha scritto: On Tue, 2013-02-12 at 23:52 +0100, Pino Toscano wrote: Alle martedì 12 febbraio 2013, Svante Signell ha

Re: [PATCH, HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Samuel Thibault
Svante Signell, le Wed 13 Feb 2013 00:17:21 +0100, a écrit : The behavior of these macros is undefined if the fd argument is less than 0 or greater than or equal to FD_SETSIZE, or if fd is not a valid file descriptor, or if any of the arguments are expressions with side-effects. Ok, so

Re: [PATCH, HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Pino Toscano
Alle mercoledì 13 febbraio 2013, Svante Signell ha scritto: On Wed, 2013-02-13 at 00:08 +0100, Pino Toscano wrote: Alle mercoledì 13 febbraio 2013, Svante Signell ha scritto: On Tue, 2013-02-12 at 23:52 +0100, Pino Toscano wrote: Alle martedì 12 febbraio 2013, Svante Signell ha scritto:

Re: [PATCH, HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Roland McGrath
Then you have to convince the Linux man page and the python3.2 developers too. From python3.2: ./Include/fileobject.h: #define _PyIsSelectable_fd(FD) (((FD) = 0) ((FD) FD_SETSIZE)) The fd value itself has to be FD_SETSIZE, since indexing is zero-origin; so that code is right. The nfds

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Richard Braun
On Wed, Feb 13, 2013 at 12:12:57AM +0100, Svante Signell wrote: What a pity, I spent a very long time doing this rewrite, and to make the code more readable (at least in my opinion). Back to spaghetti^Wold style code then. We warned you several times about making your changes as little

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Samuel Thibault
Svante Signell, le Tue 12 Feb 2013 23:46:00 +0100, a écrit : On Tue, 2013-02-12 at 22:55 +0100, Samuel Thibault wrote: Svante Signell, le Tue 12 Feb 2013 09:09:25 +0100, a écrit : Attached is a patch wrt the latest patch (step2) on January 24 2013. The indentation is different, therefore

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Samuel Thibault
Samuel Thibault, le Wed 13 Feb 2013 01:42:53 +0100, a écrit : I have rewritten your changes as seen below, and pushed to our glibc repository. This is all above Richard's io_select_timeout changes. Samuel

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Svante Signell
On Wed, 2013-02-13 at 01:53 +0100, Samuel Thibault wrote: Samuel Thibault, le Wed 13 Feb 2013 01:42:53 +0100, a écrit : I have rewritten your changes as seen below, and pushed to our glibc repository. This is all above Richard's io_select_timeout changes. Where? I cannot find it. Its not

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Svante Signell
On Wed, 2013-02-13 at 00:30 +0100, Richard Braun wrote: On Wed, Feb 13, 2013 at 12:12:57AM +0100, Svante Signell wrote: What a pity, I spent a very long time doing this rewrite, and to make the code more readable (at least in my opinion). Back to spaghetti^Wold style code then. We warned

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished

2013-02-12 Thread Richard Braun
On Wed, Feb 13, 2013 at 07:24:46AM +0100, Svante Signell wrote: We warned you several times about making your changes as little intrusive as possible for easier review. Since you seem to be unable to understand what that implies, it's only natural Samuel no longer wastes time on this and