Re: Atomicity block (Nick Maclaren)
8 Feb 2004 21:55:19 -0500

          From comp.compilers

Related articles
Atomicity block (2004-02-01)
Re: Atomicity block (Les Cargill) (2004-02-04)
Re: Atomicity block (Thad Smith) (2004-02-04)
Re: Atomicity block (2004-02-04)
Re: Atomicity block (2004-02-04)
Re: Atomicity block (2004-02-08)
Re: Atomicity block (Ken Hagan) (2004-02-12)
Re: Atomicity block (Les Cargill) (2004-02-13)
| List of all articles for this month |

From: (Nick Maclaren)
Newsgroups: comp.distributed,comp.programming,comp.compilers
Date: 8 Feb 2004 21:55:19 -0500
Organization: University of Cambridge, England
References: 04-02-022 04-02-047
Keywords: parallel
Posted-Date: 08 Feb 2004 21:55:19 EST

In article 04-02-047,
Les Cargill <> writes:
|> Alexi wrote:
|> >
|> > Many languages introduce structures/keywords for critical sections,
|> > monitors and other similar stuff that does synchronisation, mutual
|> > exclusion and etc. Is there anything similar for atomicity? ...
|> It's probably better to have an O/S ( and probably hardware ) support
|> these things, so that language/compiler implementation may remain
|> uncluttered by these issues.

However it is handled (and even "language-based" implementations often
are just wrappers for operating system calls), the language needs to
at least define the atomicity semantics. Take, for example, a simple
operation like:

        ATOMIC INTEGER count = 0;

        ATOMIC count +:= 1;

The language has to specify whether this is atomic for explicit
threads, a thread plus an interrupt handler, or both. In languages
with exception support (overflow, in this case), it has to specify
what happens when it overflows while being updated by two threads.

It gets REALLY hairy when you have peculiar, complex, non-orthogonal
and ill-specified exception mechanisms. The 'solution' to leave the
behaviour undefined so as not to handicap the implementation is almost
always a disaster, because distinction is rarely made between
"undefined" meaning unspecified reasonable behaviour and "undefined"
meaning that all hell may be let loose.

|> Ada has keywords for atomicity, but Ada didn't do very well in the
|> marketplace. Shame, it's a nice system.

Better than most, certainly.

Nick Maclaren.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.