lkml.org 
[lkml]   [1999]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: goto's ???
Date
	>the other issue is converting that code to do proper SMP locking.
Since
>2.0 many areas of the kernel were slightly changed to have a single
point
>of exit, this eases SMP locking/unlocking later on. (in that case
the exit
>point might do an unlock, which we obviously do not want to inline
like in
>your suggestions).

I read that one of the reasons Niklaus Wirth didn't put a return(value)
statement in Pascal was that he considered it no better than a goto, and he
already had goto (much to his disgust). So you had to set the function's
name to a value and jump (or find some other way) to the end of the
function. This did at least have the merit that all exits from the routine
went via the same point. (In Modula he got rid of the goto, but I don't
recall if there was a return(value). I'd given up on languages which
attempted to save the world by then.)

>there are two different issues here. First, the branch is an
'unlikely'
>case, and it's a forward branch. This means we'll never take it in
most
>cases. Sane CPUs predict (branch-history less) forward branches as
not
>taken.

Since we are about to hit the end of a routine, with associated stack
unwinding, program counter changes, etc, the number of nanoseconds saved is
unlikely to be noticed, particularly if KDE is starting.

---------------------------------------------------------------
|\ | o _ |/ Life's like a jigsaw
| \| | |_ |\ You get the straight bits
But there's something missing in the middle

Nick Brown, Strasbourg, France (Nick(dot)Brown(at)coe(dot)int)
---------------------------------------------------------------








__________________________________________________________

email address updates : @coe.int replaces @coe.fr
for more information, http://dct.coe.int/info/emfci001.htm
__________________________________________________________


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.116 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site