This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [libstdc++] remove __compare_and_swap
On Fri, Oct 05, 2001 at 12:18:02PM -0700, Nathan Myers wrote:
> On Fri, Oct 05, 2001 at 02:45:08PM -0400, Phil Edwards wrote:
> >
> > A couple weeks ago I proposed removing __compare_and_swap, an unused
> > function from the CPU configuration headers that seems to confuse port
> > maintainers:
> >
> > http://gcc.gnu.org/ml/libstdc++/2001-09/msg00069.html
>
> I apologize for not responding to the previous message.
Apology cheerfully accepted.
> Compare-and-swap is an essential primitive to maintain linked data
> structures thread-safely without using an enormously more expensive,
> unportable, and otherwise problematical mutex.
>
> We don't have much in the library yet for support of multithreaded
> programs, but eliminating primitives that such support would need
> seems like the wrong direction to go.
. o O (Will we ever have that much support?)
Okay. Given the confusion that __c_a_s has caused for port maintainers,
I suggest leaving it out until we actually try introducing MI support into
linked list structures. It would be a pain to require new ports to submit
a function that may or may not need rewriting at some arbitrary future date.
Note that the recent CRIS port never had __c_a_s in the first place. I,
personally, don't see the gain in putting the function back in if some
parts of config/cpu/ will still not have it.
After all, when MI support is actually added, we can always resurrect the
function, and /then/ ask the maintainers of CRIS and who knows what else
to implement it, when we can point to a place where it's actually being
used and tested.
Thoughts?
Phil
--
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace. We seek
not your counsel, nor your arms. Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen. - Samuel Adams