[lkml]   [1999]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: FD array expansion problem
On Fri, 29 Oct 1999 09:07:15 +0200, 
Ralf Baechle <> wrote:
>MIPS II instruction set and better and the Alpha don't have an xchg
>equivalent but ll / sc instructions, which are more universal. Using
>them to implement an xchg-like implementation however ends up as a
>a loop of at least five instructions which we'de prefarably want to avoid.

Same problem on i370. No atomic exchange, not even atomic inc, it all
has to be done using compare and swap and loop until successful. Most
of the time the update works first time and no loop is taken. IMHO, we
have to accept this overhead to simulate xchg instructions on machines
that do not have the instruction.

i370 equivalent of "xchg word,newvalue".

L R2,newvalue New value to register
loop L R1,word Current value to register
CS R1,R2,word Store new value if word is unchanged
BNE loop It changed, retry with new current value

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

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