Re: compiling locks/ monitors

Andrew Tomazos <andrew@tomazos.com>
Sat, 21 Nov 2009 16:57:01 -0800 (PST)

          From comp.compilers

Related articles
compiling locks/ monitors arnabde03@gmail.com (Arnab De) (2009-11-11)
Re: compiling locks/ monitors felipeangriman@gmail.com (Felipe Angriman) (2009-11-13)
Re: compiling locks/ monitors rogers.email@gmail.com (Ian Rogers) (2009-11-13)
Re: compiling locks/ monitors andrew@tomazos.com (Andrew Tomazos) (2009-11-21)
| List of all articles for this month |

From: Andrew Tomazos <andrew@tomazos.com>
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 <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:


        http://msdn.microsoft.com/en-us/library/ms682530%28VS.85%29.aspx


and Mutex objects:


        http://msdn.microsoft.com/en-us/library/ms684266%28VS.85%29.aspx


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


        https://computing.llnl.gov/tutorials/pthreads/#MutexOverview


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


Regards,
Andrew.
--
Andrew Tomazos <andrew@tomazos.com> <http://www.tomazos.com>



Post a followup to this message

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