Subject: Re: pthreads
To: Chris G Demetriou <Chris_G_Demetriou@lagavulin.pdl.cs.cmu.edu>
From: Gregory Kritsch <gkritsch@novice.uwaterloo.ca>
List: amiga
Date: 06/13/1995 01:12:55
> TAS uses a RMW memory cycle to insure atomicity.

Yes.

> as far as i can tell, BCLR does _NOT_ use a RMW memory cycle, and
> thus is not necessarily atomic.

Yes.

> You should use TAS (and CAS and CAS2) for atomic operations if you
> need them.  If they don't work (perhaps because the amiga doesn't
> implement RMW memory cycles?)  then you're out of luck, and MUST make
> a kernel call for atomic modifications.  (i can't think of any other
> reason they wouldn't work, and somebody [i forget who] said that they
> weren't available.) 

I have an AmigaMail from sometime around 1985 which does state that
TAS doesn't work to chip memory on the Amiga, but that was back when
there was only the 1000.  The reasoning had something to do with bus
timing and blitter cycle stealing I recall (unfortunately, the AmigaMail
in question is about 500 km away).  Therefore it is unlikely that TAS
will work in chip memory on any OCS or ECS machine.  I don't know enough
about AGA to know whether it would have changed the rules enough to let
TAS work, but it's possible.

I don't know about fast memory - I imagine some vendors would take
the effort to make sure it worked, and others would not implement it
if it saved anything at all.  Anyhow, for that reason I'd hesitate to
use it, unless some testing was done first on a lot of RAM cards.

> chris

Hope this helps clear things up.  You've got me curious to know if TAS
works now, maybe next week I'll find out (if I have some time).

Gregory