Atomic Operations (continuing on from Masking Interrupts?)

David Williams
Mon Jul 5 19:40:00 GMT 1999

Hi all,

Thanks for the helpful suggestions. I have now implemented some in line 
assembly with constraints etc. as suggested to ensure atomic operations.

This started me thinking...(very dangerous!). Some responses indicated that 
others have experienced this 'problem' before. As GCC and support for M68K 
have been around for quite some time I assume that a 'fix' in the compiler 
is probably difficult.

Has anyone considered some sort of fix for this? Is it difficult? I would 
offer my time to look at the problem, however I have not written any 
compilers, nor modified any and even though I like a challenge I am not 
sure that the time it would take to get up to speed is available to me. 
excuses, excuses, excuses...

I would have thought that by specifying a variable to be 'volatile' then it 
should be assumed that it could change at anytime. Therefore an atomic 
operation should be used, if available on the micro concerned. Otherwise 
the variable could change during a read,modify, write sequence causing a 
conflict. Any thoughts on this?

David Williams
DLC Software P/L

New CrossGCC FAQ:
To remove yourself from the crossgcc list, send
mail to with the
text 'unsubscribe' (without the quotes) in the
body of the message.

More information about the crossgcc mailing list