archives

ACM Queue: Unlocking Concurrency - Multicore programming with transactional memory

TM (transactional memory) provides a new concurrency-control construct that avoids the pitfalls of locks and significantly eases concurrent programming. It brings to mainstream parallel programming proven concurrency-control concepts used for decades by the database community. Transactional-language constructs are easy to use and can lead to programs that scale. By avoiding deadlocks and automatically allowing fine-grained concurrency, transactional-language constructs enable the programmer to compose scalable applications safely out of thread-safe libraries.

Nothing new here for LtU regulars, I guess, but you may still want to check out this column.

Continuations and freeing the stack

For an error recovery system that supports resume, I was thinking of packing the current continuation in the exception object. However, that raises an issue with freeing the resources: even though the program pointer escaped the context of the error, there is still a way to return there with "resume".

For example:

def foo(x) = 3 + (50 / x)
...
foo 0
catch
   e : DivisionByZero   e.resume 42   #the answer is 42
 | other                throw other

How do you normally deal with continuations that are returned from the current context?

YubNub for Programming Language Research

YubNub is an online command-line community extensible search engine, or as they say "a (social) command line" for the web.

Some commands which may be of interest to the community are

  • ltu - Lambda-the-Ultimate.org
  • scholar - Google scholar
  • cs - Citeseer
  • oeis - Online Encyclopedia of Integer Sequences

You can also easily create your own commands. Please share any new commands you create or find which may be relevant for the community.

[Edit: Removed "plre - Programming Language Research Engine" from the main list, since it was criticized as being self-promotional.]

The Problem with "dup" and "swap" in Stack-Based Languages

Operations like "dup" and "swap" in stack-based languages are special in that they return multiple results (unlike most other languages which simulate multiple results by returning tuples).

I find expressing the concept in a type system challenging (if anyone else has done it successfully I would definitely like to hear about it).

One of the core problems is that the type of a function like eval, which is supposed to execute any function:

  eval : (a (a -> b) -> b)

This makes a lot of sense when a function only has one argument and one result. I can reduce every function to an equivalent one having one argument:

  (a b -> c) = (a -> b -> c)

But I do not know how to reduce a function to having one result. This leads to specific problems with certain terms, which I go into more depth on my blog ( http://cdiggins.com/2006/12/09/type-ambiguity-in-cat-and-the-importance-of-formalization/ ).

The only solution I can think of is to creat another eval functions which returns two results:

  eval2 : (a (a -> b c) -> b c)

Any thoughts?