SlideShare uma empresa Scribd logo
1 de 26
Baixar para ler offline
Transactional Memory
    for Smalltalk

   Software Composition Group
        University of Bern

         Lukas Renggli
        Oscar Nierstrasz
Concurrent Programming
      in Smalltalk
   Semaphore forMutualExclusion



        RecursionLock new



            Mutex new



         SharedQueue new
Problems


   Deadlocks
   Starvation
Priority Inversion


   Complexity
Software
Transactional Memory
Programming
with Transactions
Lock Based

tree := BTree new.

lock := Semaphore forMutualExclusion.



quot; writing quot;

lock critical: [ tree at: #a put: 1 ].



quot; reading quot;

lock critical: [ tree at: #a ].
Transactional

tree := BTree new.




quot; writing quot;

[ tree at: #a put: 1 ] atomic.



quot; reading quot;

tree at: #a.
Inside Transactions
Our Approach


 Full implementation in Smalltalk


    Lazy code transformation
      Method annotations
Context dependent code execution
Static Model
Class
name                                   CompiledMethod
superclass                           * selector         1
                    selector
subclasses                     methods parseTree        method
instanceVariables




                                        AtomicMethod
                                      /selector         1
                                      /parseTree        atomicMethod
Code Transformation



     Instance Variables
     Variable Bindings


      Message Sends
Original Source Code


BTree>>at: aKey put: anObject

    | leaf |

    leaf := root leafForKey: aKey.

    leaf insertKey: aKey value: anObject.

    root := leaf root.

    ^ anObject
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
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
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
Annotate methods
that need special treatment

        Infrastructural code
         Exception handling
         Execution contexts


          Many primitives
        Variable sized objects
Dynamic Model
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
Validation
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×
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
Future Work
Implement within a
multi-core environment
Improve speed
Applications



     Concurrency Contol
    Source Code Loading
Context Oriented Programming

Mais conteúdo relacionado

Mais procurados

JRuby @ Boulder Ruby
JRuby @ Boulder RubyJRuby @ Boulder Ruby
JRuby @ Boulder RubyNick Sieger
 
JDD2015: Sharding with Akka Cluster: From Theory to Production - Krzysztof Ot...
JDD2015: Sharding with Akka Cluster: From Theory to Production - Krzysztof Ot...JDD2015: Sharding with Akka Cluster: From Theory to Production - Krzysztof Ot...
JDD2015: Sharding with Akka Cluster: From Theory to Production - Krzysztof Ot...PROIDEA
 
Reactive Extensions
Reactive ExtensionsReactive Extensions
Reactive ExtensionsKiev ALT.NET
 
Javascript Execution Context Flow
Javascript Execution Context FlowJavascript Execution Context Flow
Javascript Execution Context Flowkang taehun
 
Objective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchObjective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchMatteo Battaglio
 
Reactive Extensions, Rx
Reactive Extensions, RxReactive Extensions, Rx
Reactive Extensions, RxDima Pasko
 
Grand Central Dispatch - iOS Conf SG 2015
Grand Central Dispatch - iOS Conf SG 2015Grand Central Dispatch - iOS Conf SG 2015
Grand Central Dispatch - iOS Conf SG 2015Ben Asher
 
Building High Perf Web Apps - IE8 Firestarter
Building High Perf Web Apps - IE8 FirestarterBuilding High Perf Web Apps - IE8 Firestarter
Building High Perf Web Apps - IE8 FirestarterMithun T. Dhar
 
Clojure concurrency overview
Clojure concurrency overviewClojure concurrency overview
Clojure concurrency overviewSergey Stupin
 
Concurrency in Python
Concurrency in PythonConcurrency in Python
Concurrency in PythonGavin Roy
 
Bucks County Tech Meetup: node.js introduction
Bucks County Tech Meetup: node.js introductionBucks County Tech Meetup: node.js introduction
Bucks County Tech Meetup: node.js introductiondshkolnikov
 
"Node.js threads for I/O-bound tasks", Timur Shemsedinov
"Node.js threads for I/O-bound tasks", Timur Shemsedinov"Node.js threads for I/O-bound tasks", Timur Shemsedinov
"Node.js threads for I/O-bound tasks", Timur ShemsedinovFwdays
 
Practical introduction to dependency injection
Practical introduction to dependency injectionPractical introduction to dependency injection
Practical introduction to dependency injectionTamas Rev
 

Mais procurados (19)

Ruby 2.4 Internals
Ruby 2.4 InternalsRuby 2.4 Internals
Ruby 2.4 Internals
 
Util.promisify
Util.promisifyUtil.promisify
Util.promisify
 
JRuby @ Boulder Ruby
JRuby @ Boulder RubyJRuby @ Boulder Ruby
JRuby @ Boulder Ruby
 
(18.03.2009) Cumuy Invita - Iniciando el año conociendo nuevas tecnologías - ...
(18.03.2009) Cumuy Invita - Iniciando el año conociendo nuevas tecnologías - ...(18.03.2009) Cumuy Invita - Iniciando el año conociendo nuevas tecnologías - ...
(18.03.2009) Cumuy Invita - Iniciando el año conociendo nuevas tecnologías - ...
 
JDD2015: Sharding with Akka Cluster: From Theory to Production - Krzysztof Ot...
JDD2015: Sharding with Akka Cluster: From Theory to Production - Krzysztof Ot...JDD2015: Sharding with Akka Cluster: From Theory to Production - Krzysztof Ot...
JDD2015: Sharding with Akka Cluster: From Theory to Production - Krzysztof Ot...
 
Reactive Extensions
Reactive ExtensionsReactive Extensions
Reactive Extensions
 
Javascript Execution Context Flow
Javascript Execution Context FlowJavascript Execution Context Flow
Javascript Execution Context Flow
 
Objective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central DispatchObjective-C Blocks and Grand Central Dispatch
Objective-C Blocks and Grand Central Dispatch
 
Reactive Extensions, Rx
Reactive Extensions, RxReactive Extensions, Rx
Reactive Extensions, Rx
 
Grand Central Dispatch - iOS Conf SG 2015
Grand Central Dispatch - iOS Conf SG 2015Grand Central Dispatch - iOS Conf SG 2015
Grand Central Dispatch - iOS Conf SG 2015
 
Building High Perf Web Apps - IE8 Firestarter
Building High Perf Web Apps - IE8 FirestarterBuilding High Perf Web Apps - IE8 Firestarter
Building High Perf Web Apps - IE8 Firestarter
 
Node.js Stream API
Node.js Stream APINode.js Stream API
Node.js Stream API
 
Clojure concurrency overview
Clojure concurrency overviewClojure concurrency overview
Clojure concurrency overview
 
Concurrency in Python
Concurrency in PythonConcurrency in Python
Concurrency in Python
 
Scalable Web Apps
Scalable Web AppsScalable Web Apps
Scalable Web Apps
 
Bucks County Tech Meetup: node.js introduction
Bucks County Tech Meetup: node.js introductionBucks County Tech Meetup: node.js introduction
Bucks County Tech Meetup: node.js introduction
 
"Node.js threads for I/O-bound tasks", Timur Shemsedinov
"Node.js threads for I/O-bound tasks", Timur Shemsedinov"Node.js threads for I/O-bound tasks", Timur Shemsedinov
"Node.js threads for I/O-bound tasks", Timur Shemsedinov
 
Practical introduction to dependency injection
Practical introduction to dependency injectionPractical introduction to dependency injection
Practical introduction to dependency injection
 
Kotlin wonderland
Kotlin wonderlandKotlin wonderland
Kotlin wonderland
 

Semelhante a Transactional Memory for Smalltalk

Concurrency at the Database Layer
Concurrency at the Database Layer Concurrency at the Database Layer
Concurrency at the Database Layer mcwilson1
 
A low Overhead Per Object Write Barrier for Smalltalk
A low Overhead Per Object Write Barrier for SmalltalkA low Overhead Per Object Write Barrier for Smalltalk
A low Overhead Per Object Write Barrier for SmalltalkESUG
 
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav DukhinFwdays
 
Executing bpmn 2.0 with j bpm 3 or (at your option) any later version
Executing bpmn 2.0 with j bpm 3 or (at your option) any later versionExecuting bpmn 2.0 with j bpm 3 or (at your option) any later version
Executing bpmn 2.0 with j bpm 3 or (at your option) any later versioncamunda services GmbH
 
vert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVMvert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVMjbandi
 
Exactly-Once Made Easy: Transactional Messaging Improvement for Usability and...
Exactly-Once Made Easy: Transactional Messaging Improvement for Usability and...Exactly-Once Made Easy: Transactional Messaging Improvement for Usability and...
Exactly-Once Made Easy: Transactional Messaging Improvement for Usability and...Guozhang Wang
 
Exactly-Once Made Easy: Transactional Messaging Improvement for Usability and...
Exactly-Once Made Easy: Transactional Messaging Improvement for Usability and...Exactly-Once Made Easy: Transactional Messaging Improvement for Usability and...
Exactly-Once Made Easy: Transactional Messaging Improvement for Usability and...HostedbyConfluent
 
How to Test Asynchronous Code (v2)
How to Test Asynchronous Code (v2)How to Test Asynchronous Code (v2)
How to Test Asynchronous Code (v2)Felix Geisendörfer
 
#Pharo Days 2016 Reflectivity
#Pharo Days 2016 Reflectivity#Pharo Days 2016 Reflectivity
#Pharo Days 2016 ReflectivityPhilippe Back
 
Sps bris - Customising Office 365 on the Client side
Sps bris - Customising Office 365 on the Client sideSps bris - Customising Office 365 on the Client side
Sps bris - Customising Office 365 on the Client sideElaine Van Bergen
 
(COSCUP 2015) A Beginner's Journey to Mozilla SpiderMonkey JS Engine
(COSCUP 2015) A Beginner's Journey to Mozilla SpiderMonkey JS Engine(COSCUP 2015) A Beginner's Journey to Mozilla SpiderMonkey JS Engine
(COSCUP 2015) A Beginner's Journey to Mozilla SpiderMonkey JS EngineZongXian Shen
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialTom Croucher
 
Reflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond SmalltakReflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond SmalltakMarcus Denker
 
Embulk - 進化するバルクデータローダ
Embulk - 進化するバルクデータローダEmbulk - 進化するバルクデータローダ
Embulk - 進化するバルクデータローダSadayuki Furuhashi
 
Groovy concurrency
Groovy concurrencyGroovy concurrency
Groovy concurrencyAlex Miller
 
Learning Stream Processing with Apache Storm
Learning Stream Processing with Apache StormLearning Stream Processing with Apache Storm
Learning Stream Processing with Apache StormEugene Dvorkin
 

Semelhante a Transactional Memory for Smalltalk (20)

Lp seminar
Lp seminarLp seminar
Lp seminar
 
Concurrency at the Database Layer
Concurrency at the Database Layer Concurrency at the Database Layer
Concurrency at the Database Layer
 
A low Overhead Per Object Write Barrier for Smalltalk
A low Overhead Per Object Write Barrier for SmalltalkA low Overhead Per Object Write Barrier for Smalltalk
A low Overhead Per Object Write Barrier for Smalltalk
 
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
 
Executing bpmn 2.0 with j bpm 3 or (at your option) any later version
Executing bpmn 2.0 with j bpm 3 or (at your option) any later versionExecuting bpmn 2.0 with j bpm 3 or (at your option) any later version
Executing bpmn 2.0 with j bpm 3 or (at your option) any later version
 
vert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVMvert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVM
 
Exactly-Once Made Easy: Transactional Messaging Improvement for Usability and...
Exactly-Once Made Easy: Transactional Messaging Improvement for Usability and...Exactly-Once Made Easy: Transactional Messaging Improvement for Usability and...
Exactly-Once Made Easy: Transactional Messaging Improvement for Usability and...
 
Exactly-Once Made Easy: Transactional Messaging Improvement for Usability and...
Exactly-Once Made Easy: Transactional Messaging Improvement for Usability and...Exactly-Once Made Easy: Transactional Messaging Improvement for Usability and...
Exactly-Once Made Easy: Transactional Messaging Improvement for Usability and...
 
How to Test Asynchronous Code (v2)
How to Test Asynchronous Code (v2)How to Test Asynchronous Code (v2)
How to Test Asynchronous Code (v2)
 
#Pharo Days 2016 Reflectivity
#Pharo Days 2016 Reflectivity#Pharo Days 2016 Reflectivity
#Pharo Days 2016 Reflectivity
 
Sps bris - Customising Office 365 on the Client side
Sps bris - Customising Office 365 on the Client sideSps bris - Customising Office 365 on the Client side
Sps bris - Customising Office 365 on the Client side
 
(COSCUP 2015) A Beginner's Journey to Mozilla SpiderMonkey JS Engine
(COSCUP 2015) A Beginner's Journey to Mozilla SpiderMonkey JS Engine(COSCUP 2015) A Beginner's Journey to Mozilla SpiderMonkey JS Engine
(COSCUP 2015) A Beginner's Journey to Mozilla SpiderMonkey JS Engine
 
Extending Kubernetes
Extending KubernetesExtending Kubernetes
Extending Kubernetes
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js Tutorial
 
Ahieving Performance C#
Ahieving Performance C#Ahieving Performance C#
Ahieving Performance C#
 
Reflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond SmalltakReflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond Smalltak
 
Embulk - 進化するバルクデータローダ
Embulk - 進化するバルクデータローダEmbulk - 進化するバルクデータローダ
Embulk - 進化するバルクデータローダ
 
Groovy concurrency
Groovy concurrencyGroovy concurrency
Groovy concurrency
 
EJB Clients
EJB ClientsEJB Clients
EJB Clients
 
Learning Stream Processing with Apache Storm
Learning Stream Processing with Apache StormLearning Stream Processing with Apache Storm
Learning Stream Processing with Apache Storm
 

Mais de Lukas Renggli

Mastering Grammars with PetitParser
Mastering Grammars with PetitParserMastering Grammars with PetitParser
Mastering Grammars with PetitParserLukas Renggli
 
Natural Language Checking with Program Checking Tools
Natural Language Checking with Program Checking ToolsNatural Language Checking with Program Checking Tools
Natural Language Checking with Program Checking ToolsLukas Renggli
 
The Dynamic Language is not Enough
The Dynamic Language is not EnoughThe Dynamic Language is not Enough
The Dynamic Language is not EnoughLukas Renggli
 
Dynamic Language Embedding With Homogeneous Tool Support
Dynamic Language Embedding With Homogeneous Tool SupportDynamic Language Embedding With Homogeneous Tool Support
Dynamic Language Embedding With Homogeneous Tool SupportLukas Renggli
 
Seaside — Agile Software Development
Seaside — Agile Software DevelopmentSeaside — Agile Software Development
Seaside — Agile Software DevelopmentLukas Renggli
 
Domain-Specific Program Checking
Domain-Specific Program CheckingDomain-Specific Program Checking
Domain-Specific Program CheckingLukas Renggli
 
Embedding Languages Without Breaking Tools
Embedding Languages Without Breaking ToolsEmbedding Languages Without Breaking Tools
Embedding Languages Without Breaking ToolsLukas Renggli
 
Language Boxes — Bending the Host Language with Modular Language Changes
Language Boxes — Bending the Host Language with Modular Language ChangesLanguage Boxes — Bending the Host Language with Modular Language Changes
Language Boxes — Bending the Host Language with Modular Language ChangesLukas Renggli
 
Seaside Status Message
Seaside Status MessageSeaside Status Message
Seaside Status MessageLukas Renggli
 
Seaside - The Revenge of Smalltalk
Seaside - The Revenge of SmalltalkSeaside - The Revenge of Smalltalk
Seaside - The Revenge of SmalltalkLukas Renggli
 
Seaside - On not getting bogged down
Seaside - On not getting bogged downSeaside - On not getting bogged down
Seaside - On not getting bogged downLukas Renggli
 
Seaside - Past, Present and Future
Seaside - Past, Present and FutureSeaside - Past, Present and Future
Seaside - Past, Present and FutureLukas Renggli
 
Magritte - A Meta-Driven Approach to Empower Developers and End Users
Magritte - A Meta-Driven Approach to Empower Developers and End UsersMagritte - A Meta-Driven Approach to Empower Developers and End Users
Magritte - A Meta-Driven Approach to Empower Developers and End UsersLukas Renggli
 
Seaside - Web Development As You Like It
Seaside - Web Development As You Like ItSeaside - Web Development As You Like It
Seaside - Web Development As You Like ItLukas Renggli
 
5 Steps to Mastering the Art of Seaside
5 Steps to Mastering the Art of Seaside5 Steps to Mastering the Art of Seaside
5 Steps to Mastering the Art of SeasideLukas Renggli
 

Mais de Lukas Renggli (19)

Mastering Grammars with PetitParser
Mastering Grammars with PetitParserMastering Grammars with PetitParser
Mastering Grammars with PetitParser
 
Natural Language Checking with Program Checking Tools
Natural Language Checking with Program Checking ToolsNatural Language Checking with Program Checking Tools
Natural Language Checking with Program Checking Tools
 
The Dynamic Language is not Enough
The Dynamic Language is not EnoughThe Dynamic Language is not Enough
The Dynamic Language is not Enough
 
Dynamic Language Embedding With Homogeneous Tool Support
Dynamic Language Embedding With Homogeneous Tool SupportDynamic Language Embedding With Homogeneous Tool Support
Dynamic Language Embedding With Homogeneous Tool Support
 
Seaside — Agile Software Development
Seaside — Agile Software DevelopmentSeaside — Agile Software Development
Seaside — Agile Software Development
 
Dynamic grammars
Dynamic grammarsDynamic grammars
Dynamic grammars
 
Domain-Specific Program Checking
Domain-Specific Program CheckingDomain-Specific Program Checking
Domain-Specific Program Checking
 
Embedding Languages Without Breaking Tools
Embedding Languages Without Breaking ToolsEmbedding Languages Without Breaking Tools
Embedding Languages Without Breaking Tools
 
Language Boxes — Bending the Host Language with Modular Language Changes
Language Boxes — Bending the Host Language with Modular Language ChangesLanguage Boxes — Bending the Host Language with Modular Language Changes
Language Boxes — Bending the Host Language with Modular Language Changes
 
jQuery for Seaside
jQuery for SeasidejQuery for Seaside
jQuery for Seaside
 
Seaside Status Message
Seaside Status MessageSeaside Status Message
Seaside Status Message
 
Seaside - The Revenge of Smalltalk
Seaside - The Revenge of SmalltalkSeaside - The Revenge of Smalltalk
Seaside - The Revenge of Smalltalk
 
Magritte Blitz
Magritte BlitzMagritte Blitz
Magritte Blitz
 
Seaside - On not getting bogged down
Seaside - On not getting bogged downSeaside - On not getting bogged down
Seaside - On not getting bogged down
 
Magritte
MagritteMagritte
Magritte
 
Seaside - Past, Present and Future
Seaside - Past, Present and FutureSeaside - Past, Present and Future
Seaside - Past, Present and Future
 
Magritte - A Meta-Driven Approach to Empower Developers and End Users
Magritte - A Meta-Driven Approach to Empower Developers and End UsersMagritte - A Meta-Driven Approach to Empower Developers and End Users
Magritte - A Meta-Driven Approach to Empower Developers and End Users
 
Seaside - Web Development As You Like It
Seaside - Web Development As You Like ItSeaside - Web Development As You Like It
Seaside - Web Development As You Like It
 
5 Steps to Mastering the Art of Seaside
5 Steps to Mastering the Art of Seaside5 Steps to Mastering the Art of Seaside
5 Steps to Mastering the Art of Seaside
 

Último

Catalogue ONG NUOC PPR DE NHAT .pdf
Catalogue ONG NUOC PPR DE NHAT      .pdfCatalogue ONG NUOC PPR DE NHAT      .pdf
Catalogue ONG NUOC PPR DE NHAT .pdfOrient Homes
 
A DAY IN THE LIFE OF A SALESMAN / WOMAN
A DAY IN THE LIFE OF A  SALESMAN / WOMANA DAY IN THE LIFE OF A  SALESMAN / WOMAN
A DAY IN THE LIFE OF A SALESMAN / WOMANIlamathiKannappan
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageMatteo Carbone
 
GD Birla and his contribution in management
GD Birla and his contribution in managementGD Birla and his contribution in management
GD Birla and his contribution in managementchhavia330
 
Regression analysis: Simple Linear Regression Multiple Linear Regression
Regression analysis:  Simple Linear Regression Multiple Linear RegressionRegression analysis:  Simple Linear Regression Multiple Linear Regression
Regression analysis: Simple Linear Regression Multiple Linear RegressionRavindra Nath Shukla
 
Progress Report - Oracle Database Analyst Summit
Progress  Report - Oracle Database Analyst SummitProgress  Report - Oracle Database Analyst Summit
Progress Report - Oracle Database Analyst SummitHolger Mueller
 
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature Set
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature SetCreating Low-Code Loan Applications using the Trisotech Mortgage Feature Set
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature SetDenis Gagné
 
The Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case studyThe Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case studyEthan lee
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Delhi Call girls
 
Cash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call GirlsCash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call GirlsApsara Of India
 
Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Roland Driesen
 
Eni 2024 1Q Results - 24.04.24 business.
Eni 2024 1Q Results - 24.04.24 business.Eni 2024 1Q Results - 24.04.24 business.
Eni 2024 1Q Results - 24.04.24 business.Eni
 
Call Girls in Gomti Nagar - 7388211116 - With room Service
Call Girls in Gomti Nagar - 7388211116  - With room ServiceCall Girls in Gomti Nagar - 7388211116  - With room Service
Call Girls in Gomti Nagar - 7388211116 - With room Servicediscovermytutordmt
 
VIP Kolkata Call Girl Howrah 👉 8250192130 Available With Room
VIP Kolkata Call Girl Howrah 👉 8250192130  Available With RoomVIP Kolkata Call Girl Howrah 👉 8250192130  Available With Room
VIP Kolkata Call Girl Howrah 👉 8250192130 Available With Roomdivyansh0kumar0
 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdfRenandantas16
 
The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024christinemoorman
 

Último (20)

Forklift Operations: Safety through Cartoons
Forklift Operations: Safety through CartoonsForklift Operations: Safety through Cartoons
Forklift Operations: Safety through Cartoons
 
Catalogue ONG NUOC PPR DE NHAT .pdf
Catalogue ONG NUOC PPR DE NHAT      .pdfCatalogue ONG NUOC PPR DE NHAT      .pdf
Catalogue ONG NUOC PPR DE NHAT .pdf
 
A DAY IN THE LIFE OF A SALESMAN / WOMAN
A DAY IN THE LIFE OF A  SALESMAN / WOMANA DAY IN THE LIFE OF A  SALESMAN / WOMAN
A DAY IN THE LIFE OF A SALESMAN / WOMAN
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
 
GD Birla and his contribution in management
GD Birla and his contribution in managementGD Birla and his contribution in management
GD Birla and his contribution in management
 
Regression analysis: Simple Linear Regression Multiple Linear Regression
Regression analysis:  Simple Linear Regression Multiple Linear RegressionRegression analysis:  Simple Linear Regression Multiple Linear Regression
Regression analysis: Simple Linear Regression Multiple Linear Regression
 
Nepali Escort Girl Kakori \ 9548273370 Indian Call Girls Service Lucknow ₹,9517
Nepali Escort Girl Kakori \ 9548273370 Indian Call Girls Service Lucknow ₹,9517Nepali Escort Girl Kakori \ 9548273370 Indian Call Girls Service Lucknow ₹,9517
Nepali Escort Girl Kakori \ 9548273370 Indian Call Girls Service Lucknow ₹,9517
 
Progress Report - Oracle Database Analyst Summit
Progress  Report - Oracle Database Analyst SummitProgress  Report - Oracle Database Analyst Summit
Progress Report - Oracle Database Analyst Summit
 
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature Set
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature SetCreating Low-Code Loan Applications using the Trisotech Mortgage Feature Set
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature Set
 
The Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case studyThe Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case study
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
 
Cash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call GirlsCash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call Girls
 
Best Practices for Implementing an External Recruiting Partnership
Best Practices for Implementing an External Recruiting PartnershipBest Practices for Implementing an External Recruiting Partnership
Best Practices for Implementing an External Recruiting Partnership
 
Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...
 
KestrelPro Flyer Japan IT Week 2024 (English)
KestrelPro Flyer Japan IT Week 2024 (English)KestrelPro Flyer Japan IT Week 2024 (English)
KestrelPro Flyer Japan IT Week 2024 (English)
 
Eni 2024 1Q Results - 24.04.24 business.
Eni 2024 1Q Results - 24.04.24 business.Eni 2024 1Q Results - 24.04.24 business.
Eni 2024 1Q Results - 24.04.24 business.
 
Call Girls in Gomti Nagar - 7388211116 - With room Service
Call Girls in Gomti Nagar - 7388211116  - With room ServiceCall Girls in Gomti Nagar - 7388211116  - With room Service
Call Girls in Gomti Nagar - 7388211116 - With room Service
 
VIP Kolkata Call Girl Howrah 👉 8250192130 Available With Room
VIP Kolkata Call Girl Howrah 👉 8250192130  Available With RoomVIP Kolkata Call Girl Howrah 👉 8250192130  Available With Room
VIP Kolkata Call Girl Howrah 👉 8250192130 Available With Room
 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
 
The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024
 

Transactional Memory for Smalltalk

  • 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
  • 6. Lock Based tree := BTree new. lock := Semaphore forMutualExclusion. quot; writing quot; lock critical: [ tree at: #a put: 1 ]. quot; reading quot; lock critical: [ tree at: #a ].
  • 7. Transactional tree := BTree new. quot; writing quot; [ tree at: #a put: 1 ] atomic. quot; reading quot; tree at: #a.
  • 9. Our Approach Full implementation in Smalltalk Lazy code transformation Method annotations Context dependent code execution
  • 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
  • 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
  • 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
  • 26. Applications Concurrency Contol Source Code Loading Context Oriented Programming