
"Holger Grund" <yahoo@ix-n.net> wrote
It's probably much harder for certain other architectures.
You are right. The rationale for providing API for singly-linked list is, I believe, based on typical library/reusability/avoid-boilerplate code mantra. There is a body of work for implementing Intel-like CAS (conditional store and swap) via LL/SC (load linked/store conditional) instructions on other architectures (notably Motorola). IMO, the issue boils down to usefulness of adding such functionality to the part of the library that deals with concurrency. Personally, I find it very useful, even if I would never claim that all concurrent data-access issues boil down to thread-safe access to standard containers. In my view, it is library functions like thread.join(0 that are trivial enough so that anybody can keep reimplementing them in his platform-specific programs, while thread-safe containers are nontrivial and error-prone enough to deserve resuable library implementation. Tony