Headline

A Clojure-based implementation that uses transactional references

Motivation

Clojure provides a number of interesting approaches to the development with concurrency. One of these approaches is the use of programmable transactions, analogous to database transactions. This functionality is implemented by means of transaction-specific functions and references. To maintain a consistent memory state, Clojure relies on a STM. This project is based on the implementation Contribution:clojure and changes it so that Refs and transactions are used.

Illustration

Changes to Refs by a transformation like Feature:Cut have to be encapsulated into a transaction. In Clojure the function dosync starts such a transaction allowing to alter Refs by an update function.

(defn cutCompany [c]
    (dosync
        ;; alter ref function
        (alter c #(update-in % [:depts] (partial map cutDept))))
    ;; returning changed ref
    c)

Architecture

Usage

You need to install the Eclipse plugin CounterClockwise. Update Site: http://ccw.cgrand.net/updatesite

Then open meganalysis.clj, hit "run" and excute the function you like:

  • (totalCompany meganalysis)
  • (cutCompany meganalysis)
The implementation has been tested with Eclipse version 3.7 and Technology:CounterClockwise Eclipse plugin (Version 0.3.0).

Metadata


Kevin edited this article at Wed, 31 May 2017 15:42:22 +0200
Compare revisions Compare revisions

User contributions

    This user never has never made submissions.

    User edits

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.

    10 most similar pages:

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.