|compiling locks/ monitors email@example.com (Arnab De) (2009-11-11)|
|Re: compiling locks/ monitors firstname.lastname@example.org (Felipe Angriman) (2009-11-13)|
|Re: compiling locks/ monitors email@example.com (Ian Rogers) (2009-11-13)|
|Re: compiling locks/ monitors firstname.lastname@example.org (Andrew Tomazos) (2009-11-21)|
|From:||Andrew Tomazos <email@example.com>|
|Date:||Sat, 21 Nov 2009 16:57:01 -0800 (PST)|
|Posted-Date:||27 Nov 2009 11:41:03 EST|
On Nov 11, 3:08 pm, Arnab De <arnabd...@gmail.com> 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 <firstname.lastname@example.org> <http://www.tomazos.com>
Return to the
Search the comp.compilers archives again.