|Atomicity block firstname.lastname@example.org (2004-02-01)|
|Re: Atomicity block email@example.com (Les Cargill) (2004-02-04)|
|Re: Atomicity block firstname.lastname@example.org (Thad Smith) (2004-02-04)|
|Re: Atomicity block email@example.com (2004-02-04)|
|Re: Atomicity block firstname.lastname@example.org (2004-02-04)|
|Re: Atomicity block email@example.com (2004-02-08)|
|Re: Atomicity block K.Hagan@thermoteknix.co.uk (Ken Hagan) (2004-02-12)|
|Re: Atomicity block firstname.lastname@example.org (Les Cargill) (2004-02-13)|
|From:||email@example.com (Nick Maclaren)|
|Date:||8 Feb 2004 21:55:19 -0500|
|Organization:||University of Cambridge, England|
|Posted-Date:||08 Feb 2004 21:55:19 EST|
In article 04-02-047,
Les Cargill <firstname.lastname@example.org> 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
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.
Return to the
Search the comp.compilers archives again.