Wednesday, July 29, 2009

.Net 4 Beta 1 “Experimental Edition” – C# programmers getting “Software Transactional Memory,” STM.NET

InfoQ.NET 4 Beta 1 Now Supports Software Transactional Memory

“Microsoft has released a new version of .NET 4.0 Beta 1, one that incorporates STM.NET, the Software Transactional Memory. STM is an alternative mechanism to lock-based synchronization used to control the concurrent access to shared memory.

STM uses an optimistic approach to accessing a shared piece of memory. Instead of blocking the writer until it is safe to perform the changes to the shared data, the thread accesses and edits the shared data while logging each read and write it performs. In the end, it verifies if another thread has happened to access the shared data in the same time. If not, a commit is executed and the changes are made permanent. If another thread has accessed the data, the transaction is aborted, and all changes are rolled back.

STM.NET uses Atomic.Do() to mark statements that are to be executed as one transaction:

Requirements: Visual Studio 2008, Windows Installer 3.1 or later, Internet Explorer 5.01 or later. STM.NET is currently available only for C#.”

All About Microsoft - Microsoft releases second, 'experimental' version of .Net 4 Beta 1

“Microsoft released its first Beta of Visual Studio 2010 and the accompanying .Net Framework 4.0 back in May. On July 28, Microsoft announced it was releasing a second version of .Net 4.0 Beta 1.

Huh? That was my reaction when I saw a tweet about it earlier today. (Thanks for that, dotnetangel.)

But, yes, it’s true, as Senior Vice President of Microsoft’s Developer Division Soma Somasegar blogged today, calling the second version of .Net 4.0 Beta 1, STM.Net (with STM =  software transactional memory), an “experimental” release. Somasegar said Microsoft had made the STM.Net code available for download via the MSDN DevLabs site.

…”

Somasegar's WebLog - STM.NET on DevLabs

“Today we made available STM.NET on MSDN DevLabs. STM.NET is an experimental enhanced version of .NET Framework 4 Beta 1 that enables software transactional memory for C# programmers.

Transactional memory is a technology that frees developers from worrying about the mechanics of fine-grained locking and synchronization in multithreaded applications by providing transactional semantics for reading and writing to memory. It enables developers to focus on application logic instead of the details of memory I/O when building multi-core and many-core programs.

….

One of the best aspects of STM.NET is its integration with Visual Studio tooling. STM.NET works with the Visual Studio 2008 debugger to allow you to see the values of transacted variables as they appear while running inside the Atomic.Do delegate as well as their values as they appear outside.

STM.NET is available for download today. Share your thoughts and experiences on the project’s forum, and read more about STM.NET on the STM.NET Team Blog.

…”

Interesting, in both the technology and how this is a .Net 4 thing that runs in VS2008. I like the concept behind STM, but will sit on the sidelines watching until there’s VB.Net support and it’s baked a little more. Still it’s nice to see this kind of thing moving forward…

1 comment:

Ed Dinovo said...

Hardware transactional memory seems like it's an inevitability -- all the top companies are writing papers about it for the trade journals.