On Thu, Jun 22, 2017 at 11:46 AM, Brian Brooks <[email protected]> wrote: >> > > The first is built only for ARM and the second for the rest. Would there >> > >be a way to build both always ? >> > For ARMv7a and ARMv8a, you could build both versions. You really want to >> > use the LL/SC version on these architectures. >> > >> > For architectures without double-word LL/SC, only the lock-based version >> > can be built. >> >> >> You could *compile* the lock version always. It's based on locks, not on >> arch specific instructions. > > That would require an abstraction layer consisting of function pointers > pointing to one of the two implementations. On architectures without support > for LLD/SCD, there would only be one implementation. > > This could make sense if... you were benchmarking *many* different concurrent > queue implementations and wanted to keep the benchmark code extremely succinct > and were willing to pay for function pointers. But that is not the case here. > > This code is deliberately written to be static inline and conditionally > compiled.
We're going to need to think about how to make microarchitecture distinctions like this dynamic since we want a single binary to be distributed to all ARM architectures. I agree that such dynamism is outside the scope of this series, but it's something we're going to need as the cloud work progresses. > >> -Petri >>
