By: Patrick Chase (patrickjchase.delete@this.gmail.com), August 25, 2014 10:15 am
Room: Moderated Discussions
Maynard Handley (name99.delete@this.name99.org) on August 17, 2014 9:52 am wrote:
> So getting back to LL/SC, was it considered in, say, the context of Alpha
> and Ultrix a terrible idea? Would the alternatives have been better?
For MIPS it was a terrific idea because they probably couldn't have done it any other way given the transistor budgets for, say, R2000.
My take from long experience using atomics on x86 and ARM is that:
1. I've never found anything that I wanted to do that LL/SC allowed but for which x86 didn't have an equivalent idiom. I think that the increased flexibility is mostly theoretical
2. If used naively LL/SC is indeed prone to livelock as others have pointed out, but that's a pretty simple problem to solve in SW.
3. LL/SC is perhaps more difficult to exploit in SW for the reasons that 'nksingh' gave, but no more so than, say, figuring out all of the places where you need fences/barriers in a driver.
4. We're talking about stuff that's done in the OS or at the level of foundational libraries like 'glibc' or 'boost' here. People who work on those are supposed to be able to deal with this sort of complexity. If you have a lot of people messing with LL/SC and actually bumping into this then IMO your SW stack is factored poorly.
So my bottom line take would be: Either works, neither is clearly superior to the other. They're just different idioms for different sorts of ISA. Some people might find one or the other aesthetically preferable, but that's all.
> So getting back to LL/SC, was it considered in, say, the context of Alpha
> and Ultrix a terrible idea? Would the alternatives have been better?
For MIPS it was a terrific idea because they probably couldn't have done it any other way given the transistor budgets for, say, R2000.
My take from long experience using atomics on x86 and ARM is that:
1. I've never found anything that I wanted to do that LL/SC allowed but for which x86 didn't have an equivalent idiom. I think that the increased flexibility is mostly theoretical
2. If used naively LL/SC is indeed prone to livelock as others have pointed out, but that's a pretty simple problem to solve in SW.
3. LL/SC is perhaps more difficult to exploit in SW for the reasons that 'nksingh' gave, but no more so than, say, figuring out all of the places where you need fences/barriers in a driver.
4. We're talking about stuff that's done in the OS or at the level of foundational libraries like 'glibc' or 'boost' here. People who work on those are supposed to be able to deal with this sort of complexity. If you have a lot of people messing with LL/SC and actually bumping into this then IMO your SW stack is factored poorly.
So my bottom line take would be: Either works, neither is clearly superior to the other. They're just different idioms for different sorts of ISA. Some people might find one or the other aesthetically preferable, but that's all.