Re: compiling locks/ monitors

Andrew Tomazos <>
Sat, 21 Nov 2009 16:57:01 -0800 (PST)

          From comp.compilers

Related articles
compiling locks/ monitors (Arnab De) (2009-11-11)
Re: compiling locks/ monitors (Felipe Angriman) (2009-11-13)
Re: compiling locks/ monitors (Ian Rogers) (2009-11-13)
Re: compiling locks/ monitors (Andrew Tomazos) (2009-11-21)
| List of all articles for this month |

From: Andrew Tomazos <>
Newsgroups: comp.compilers
Date: Sat, 21 Nov 2009 16:57:01 -0800 (PST)
Organization: Compilers Central
References: 09-11-037
Keywords: parallel
Posted-Date: 27 Nov 2009 11:41:03 EST

On Nov 11, 3:08 pm, Arnab De <> wrote:
> Many modern high level languages like Java/ C# have locks/ monitors as
> language level features. Hardwares typically have lower level
> synchronization primitives like CAS. One can implement a spinlock
> using CAS, but it is bad for performance as it busy-waits for the lock
> to be released. Can anyone tell me how these locks/monitors are
> typically and efficiently compiled? Can you cite any paper on this?

In the Windows API there are CriticalSection objects:

and Mutex objects:

Under the POSIX API (implemented by NPTL under Linux) there are

I think maybe that the locks provided by Java and C# are just wrappers
for these system calls. I am not 100% sure though.

Andrew Tomazos <> <>

Post a followup to this message

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