Transactional Memory for Smalltalk

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite

    Transactional Memory for Smalltalk - Presentation Transcript

    1. Transactional Memory for Smalltalk Software Composition Group University of Bern Lukas Renggli Oscar Nierstrasz
    2. Concurrent Programming in Smalltalk Semaphore forMutualExclusion RecursionLock new Mutex new SharedQueue new
    3. Problems Deadlocks Starvation Priority Inversion Complexity
    4. Software Transactional Memory
    5. Programming with Transactions
    6. Lock Based tree := BTree new. lock := Semaphore forMutualExclusion. \" writing \" lock critical: [ tree at: #a put: 1 ]. \" reading \" lock critical: [ tree at: #a ].
    7. Transactional tree := BTree new. \" writing \" [ tree at: #a put: 1 ] atomic. \" reading \" tree at: #a.
    8. Inside Transactions
    9. Our Approach Full implementation in Smalltalk Lazy code transformation Method annotations Context dependent code execution
    10. Static Model
    11. Class name CompiledMethod superclass * selector 1 selector subclasses methods parseTree method instanceVariables AtomicMethod /selector 1 /parseTree atomicMethod
    12. Code Transformation Instance Variables Variable Bindings Message Sends
    13. Original Source Code BTree>>at: aKey put: anObject | leaf | leaf := root leafForKey: aKey. leaf insertKey: aKey value: anObject. root := leaf root. ^ anObject
    14. Transformed Source Code BTree>>__atomic__at: aKey put: anObject | leaf | leaf := (self atomicInstVarAt: 1) __atomic__leafForKey: aKey. leaf __atomic__insertKey: aKey value: anObject. self atomicInstVarAt: 1 put: leaf __atomic__root. ^ anObject
    15. Transformed Source Code BTree>>__atomic__at: aKey put: anObject | leaf | leaf := (self atomicInstVarAt: 1) __atomic__leafForKey: aKey. leaf __atomic__insertKey: aKey value: anObject. self atomicInstVarAt: 1 put: leaf __atomic__root. ^ anObject
    16. Transformed Source Code BTree>>__atomic__at: aKey put: anObject | leaf | leaf := (self atomicInstVarAt: 1) __atomic__leafForKey: aKey. leaf __atomic__insertKey: aKey value: anObject. self atomicInstVarAt: 1 put: leaf __atomic__root. ^ anObject
    17. Annotate methods that need special treatment Infrastructural code Exception handling Execution contexts Many primitives Variable sized objects
    18. Dynamic Model
    19. Transaction Change escapeContext 0..1 do: aBlock * Process apply currentTransaction retry: aBlock changes hasChanged checkpoint object hasConflict abort: anObject * ObjectChange CustomChange previousCopy applyBlock workingCopy conflictTestBlock
    20. Validation
    21. Speed Comparison Method Invocation 1× Special Method Invocation 2× Instance Variable Read 20× Instance Variable Write 19× Indexed Variable Read 18× Indexed Variable Write 17× 5× 10× 15× 20× 25×
    22. Performance of n concurrent t [ms] 800.0 edit operations in Pier 700.0 1 CPU 600.0 500.0 400.0 2 CPUs 300.0 200.0 4 CPUs 100.0 8 CPUs 0.0 n 0 10 20 30 40 50 60 70 80 90 100 non-synchronized lock-based transactional
    23. Future Work
    24. Implement within a multi-core environment
    25. Improve speed
    26. Applications Concurrency Contol Source Code Loading Context Oriented Programming

    + Lukas RenggliLukas Renggli, 2 years ago

    custom

    1208 views, 1 favs, 2 embeds more stats

    Concurrency control is mostly based on locks and is more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1208
      • 1206 on SlideShare
      • 2 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 20
    Most viewed embeds
    • 1 views on http://localhost:8080
    • 1 views on http://static.slidesharecdn.com

    more

    All embeds
    • 1 views on http://localhost:8080
    • 1 views on http://static.slidesharecdn.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories