Re: Atomicity block

Thad Smith <thad@ionsky.com>
4 Feb 2004 21:43:56 -0500

          From comp.compilers

Related articles
Atomicity block alexili@ms.kyrnet.kg (2004-02-01)
Re: Atomicity block lcargill@worldnet.att.net (Les Cargill) (2004-02-04)
Re: Atomicity block thad@ionsky.com (Thad Smith) (2004-02-04)
Re: Atomicity block tlh20@cus.cam.ac.uk (2004-02-04)
Re: Atomicity block eventhelix@hotmail.com (2004-02-04)
Re: Atomicity block nmm1@cus.cam.ac.uk (2004-02-08)
Re: Atomicity block K.Hagan@thermoteknix.co.uk (Ken Hagan) (2004-02-12)
Re: Atomicity block lcargill@worldnet.att.net (Les Cargill) (2004-02-13)
| List of all articles for this month |

From: Thad Smith <thad@ionsky.com>
Newsgroups: comp.distributed,comp.programming,comp.compilers
Date: 4 Feb 2004 21:43:56 -0500
Organization: Compilers Central
References: 04-02-022
Keywords: parallel
Posted-Date: 04 Feb 2004 21:43:56 EST

Alexi wrote:


> If we are speaking in terms of some high-level language, can we build
> atomicity using monitors and mutexes (ignoring async signals)? I mean
> if one protects all the global variables using mutexes, puts monitor
> on the method, will he get atomic routine?


It depends on what you mean by atomic. Mutexes can be used to prevent
inhibit access to any particular resource by a routine which utilizes
the mutex for that purpose. That is usually sufficient. That doesn't
apply to interrupt routines, though, which cannot wait on a mutex. If
you want to inhibit them, you need to disable the interrupt. If you
are running on a multiprocessor with each processor having access to a
common memory, even disabling interrupts doesn't work there. There
are usually bus locks for multiprocessing systems for this sort of
thing, but they are usually only implemented for very short sequences,
such as incrementing a memory location or test-and-set instruction.


Thad


Post a followup to this message

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