[Omp] Shared Variable Problem

Eugene Loh Eugene.Loh at Sun.COM
Tue Aug 1 13:02:24 PDT 2006


Meadows, Lawrence F wrote:

> Perhaps we want to introduce an atomic {} construct.

Maybe even call it "transactional memory"?    :^)



P.S.  For anyone unfamiliar with it, "transactional memory" is a
lock-free programming model in which the programmer "simply"
specifies which memory transactions should occur atomically.
Not only can the memory transactions violate the sorts of conditions
that are forced on us today (e.g.,  single whole words, properly
aligned, etc.), but they can actually be rather complicated (e.g., the
atomic memory transaction can specify a noncontiguous address range).
E.g., you may want the transaction to be an insertion into a doubly
linked list:

    transaction {
        IF ( PREV(J) == I && NEXT(I) == J ) {
            NEXT(I) = K
            PREV(J) = K
            NEXT(K) = J
            PREV(K) = I
        }
    }

(Don't look at the syntax too closely.)

Over the next years, various processors will have some amount of
hardware support for such programming and the support will be
improved further with hybrid (hardware-software) schemes.


More information about the Omp mailing list