Composable Memory Transactions

This paper describes a technique for creating composable transactions, based in Haskell. It's an extremely elegant approach, for reasons which are completely unrelated to the fact that it's written in Haskell. Haskell merely allows them to give a static guarantee (via the type system) that the transaction system isn't perverted by the inclusion of non-transactional code.

You may think that "composable memory transactions" are not something that you have ever felt a need for, and therefore this paper is irrelevant to your life. However what the paper is really about is synchronization primitives for multithreaded code -- a topic that I have to deal with all the time. It just so happens that their proposed synchronization primitive has lots of other uses as well.

The authors point out that blocking within a transaction is not composable (due to the potential for deadlocks when other threads wait for locks that the transaction has already aquired), and that if you attempt to avoid blocking by introducing guards on transactions, then that also prevents composability. So instead of allowing blocking, they introduce a "retry" function which aborts the transaction and then schedules it for later execution. As an optimization, they put off rescheduling the transaction until at least one of the variables referenced before the retry has changed. In this way, they have the effect of blocking the calling thread, without locking the transactional store.

In the context of Haskell, the authors simply make retry into a function which returns a special value, which takes priority over any other values it is composed with. This is relatively elegant in the context of Monads, however I think the same effect could achieved in an imperative language by making retry throw a RetryException -- so the technique is not limited to functional programming. On the other hand, imperative languages make it so easy to modify global state that it may probably be difficult to apply the technique reliably to such languages.

(Via Lambda the Ultimate)

Posted on January 10, 2005 06:24 PM
More languages articles

Comments

In fact this could be implemented and easily used on a imperative language. I'm currently developing a library to meet this on C:

http://libcmt.sourceforge.net


Best Regards.

Posted by: Duilio Protti at December 3, 2005 03:51 PM

The LibCMT library now comes with a C# binding, so you can use these Composable Memory Transactions within the .Net environment.

Posted by: Duilio Protti at March 11, 2006 02:58 PM

People all over the world know the abercrombie and fitch,but not everyone really knows how fashion the abercrombie is,hollister is the Legend maker. Everybody wears the hollister clothing would be the abercrombie mensand the abercrombie womens, if you want know you can search the Ruehl No.925 or abercrombie outlet in the www.google.com .

Posted by: fitch at November 14, 2009 02:04 AM

Uggs on sale now.UGG Classic Cardy Boot makes me different form the other

girls. The UGG Bailey Button Boot is a good choice for female.

Posted by: ugg classic cardy boots at November 17, 2009 12:56 AM

The 39.html">classic cardy uggs boots is another hot boots that worth of buying.And the classic tall ugg boots
will make your winter amusing.And now uggs on sale,if you are looking for such a boot,the ugg boots is good choice this year.

Posted by: UGG Bailey Button Boots at November 17, 2009 12:58 AM

Louis Vuitton , commonly referred to as Louis Vuitton, Gucci, Chanel,Tiffany Store New York America and Authentic Louis Vuitton Online Shop, or sometimes shortened to Luis Bags has become one of the most Louis Vuitton Replicas Agendas luxurybrands How and Where to Buy LV Designer Handbag.

Posted by: 1 at November 17, 2009 02:00 AM

I started wearing Ugg boots a couple of years ago and bought short boots last fall. I wear my Uggs pretty much everyday because I work in an environment where I can dress casually. The product Uggs boots on sale are made from sheepskin. They look like soft.

Posted by: ugg boots at November 17, 2009 08:42 PM

Great packing and shipping!! love the

href="http://www.mytobling.com/ugg-mayfaire-boots-c-

99.html">ugg mayfaire boots

! thanks!

Posted by: aetrewte at November 19, 2009 08:35 PM

Great packing and shipping!! love the

href="http://www.mytobling.com/ugg-mayfaire-boots-c-

99.html">ugg mayfaire boots

! thanks!

Posted by: aetrewte at November 19, 2009 08:35 PM

We are the best online sales for the china wholesale . Here you can have a large of choices of kinds Ugg Boots,Converse Shoes,Timberland Boots,puma shoes,Nike Shox Shoes ,Nike Dunk SB Shoes,Nike Air Max,Links Of London,Tiffany Jewelry,Dior Handbags?,jimmy choo handbags ,Cartier Watches, 8GB Mp4 Players,Bluetooth Car DVDs. All our cheap online cheap goods are high quality and original packages, and best service. We offer our customers the best service, 7 days arrive at your door.Enjoy your easy and happy shopping with us.

Posted by: cheap goods sale. at November 20, 2009 01:38 AM

Laptop Battery Laptop Battery Laptop Batteries
Laptop Batteries discount laptop battery
discount laptop battery
notebook battery notebook battery
computer battery computer battery
replacement laptop battery replacement laptop battery
notebook batteries notebook batteries

Posted by: Laptop Battery at November 24, 2009 09:56 PM

Ugg Classic Cardy

Boots

Ugg Classic Tall

Boots

Ugg Classic Short

Boots

Posted by: topuggshoes at November 26, 2009 02:50 AM

Just wanted to say great job with the blog, today is my first visit here and I’ve enjoyed reading your posts so far
ugg bailey button
Wow, my ugg classic mini will not be coming off now! I’ve had them on for 12hrs strait and I do not want to take them off. Thanks for everything, well worth the wait.

Posted by: ugg bailey button boots at November 30, 2009 05:53 AM

Just wanted to say great job with the blog, today is my first visit here and I’ve enjoyed reading your posts so far
ugg bailey button
Wow, my ugg classic mini will not be coming off now! I’ve had them on for 12hrs strait and I do not want to take them off. Thanks for everything, well worth the wait.

Posted by: ugg bailey button boots at November 30, 2009 05:55 AM

Spring is near,every girl wants to be the bride in the special season.They are eager to put on beautiful Wedding Dresses or the Bridal gowns.During the day the Wedding gowns is the good choose,and the night,if you want radiant,you need the Evening gowns.
About the bridesmaid,they have to wear Bridesmaid Dresses in order to avoid grab limelight with the bride.And the Flower Girl has the Flower Girl Dresses,too.In the wedding,the Cocktail Dresses and the Evening Dresses is necessary,too!And remember,the Wedding Dress of the Bridal Dress must be the most glaring!

Posted by: weddingdressclub at December 1, 2009 02:02 AM

Classical And Simple Style Of Louis Vuitton Spring 2010 .Let's Go On Holiday! Cheap Louis Vuitton Louis Vuitton Outlet Store and Louis Vuitton Handbags Of LV Replica Handbags IBM Exam I Chinese Advertisement,Good Pictures But Bad Concept.Special QR Designed By IBM Exam III & Certified Administrator Exam.

Posted by: louis at December 3, 2009 12:34 AM
Post a comment









Remember info?




Prove you're human. Type "human":