SlideShare a Scribd company logo
1 of 102
Exploring Maglev

           Rudi Engelbrecht



            Rubyfuza, Cape Town, 2-3 Feb 2012
lautus
MagLev History




             Rubyfuza - Cape Town - 2012
MagLev History

  • Smalltalk Virtual Machine




                      Rubyfuza - Cape Town - 2012
MagLev History

  • Smalltalk Virtual Machine
   • Mature, used in production, large sites




                         Rubyfuza - Cape Town - 2012
MagLev History

  • Smalltalk Virtual Machine
   • Mature, used in production, large sites
  • GemStone


                         Rubyfuza - Cape Town - 2012
MagLev History

  • Smalltalk Virtual Machine
   • Mature, used in production, large sites
  • GemStone
   • Transactional Memory Object Server for Smalltalk


                         Rubyfuza - Cape Town - 2012
MagLev History

  • Smalltalk Virtual Machine
   • Mature, used in production, large sites
  • GemStone
   • Transactional Memory Object Server for Smalltalk
  • Maglev
                         Rubyfuza - Cape Town - 2012
MagLev History

  • Smalltalk Virtual Machine
   • Mature, used in production, large sites
  • GemStone
   • Transactional Memory Object Server for Smalltalk
  • Maglev
   • Transactional Memory Object Server for Ruby
                         Rubyfuza - Cape Town - 2012
MagLev Concepts




             Rubyfuza - Cape Town - 2012
MagLev Concepts
  • Root Object




                  Rubyfuza - Cape Town - 2012
MagLev Concepts
  • Root Object
  • Persistency by Reachability




                      Rubyfuza - Cape Town - 2012
MagLev Concepts
  • Root Object
  • Persistency by Reachability
   • transitive closure




                          Rubyfuza - Cape Town - 2012
MagLev Concepts
  • Root Object
  • Persistency by Reachability
   • transitive closure
  • Repository


                          Rubyfuza - Cape Town - 2012
MagLev Concepts
  • Root Object
  • Persistency by Reachability
   • transitive closure
  • Repository
  • Ruby Virtual Machines

                          Rubyfuza - Cape Town - 2012
MagLev Concepts
  • Root Object
  • Persistency by Reachability
   • transitive closure
  • Repository
  • Ruby Virtual Machines
   • local vs remote virtual machines
                          Rubyfuza - Cape Town - 2012
MagLev Concepts
  • Root Object
  • Persistency by Reachability
   • transitive closure
  • Repository
  • Ruby Virtual Machines
   • local vs remote virtual machines
  • Garbage Collector
                          Rubyfuza - Cape Town - 2012
MagLev Concepts




             Rubyfuza - Cape Town - 2012
MagLev Concepts
  • Transparent Object Persistence




                    Rubyfuza - Cape Town - 2012
MagLev Concepts
  • Transparent Object Persistence
  • Large Object Space



                    Rubyfuza - Cape Town - 2012
MagLev Concepts
  • Transparent Object Persistence
  • Large Object Space
   • limited by disk space (not RAM)



                        Rubyfuza - Cape Town - 2012
MagLev Concepts
  • Transparent Object Persistence
  • Large Object Space
   • limited by disk space (not RAM)
  • Multi-user


                        Rubyfuza - Cape Town - 2012
MagLev Concepts
  • Transparent Object Persistence
  • Large Object Space
   • limited by disk space (not RAM)
  • Multi-user
   • Thousands of virtual machines

                        Rubyfuza - Cape Town - 2012
MagLev Concepts
  • Transparent Object Persistence
  • Large Object Space
   • limited by disk space (not RAM)
  • Multi-user
   • Thousands of virtual machines
   • Sharing one object space
                        Rubyfuza - Cape Town - 2012
MagLev Concepts
  • Transparent Object Persistence
  • Large Object Space
   • limited by disk space (not RAM)
  • Multi-user
   • Thousands of virtual machines
   • Sharing one object space
   • Isolation of each user’s view (repeatable read)
                         Rubyfuza - Cape Town - 2012
MagLev Concepts




             Rubyfuza - Cape Town - 2012
MagLev Concepts

  • Concurrency



                  Rubyfuza - Cape Town - 2012
MagLev Concepts

  • Concurrency
   • Multi Version Concurrency Control



                       Rubyfuza - Cape Town - 2012
MagLev Concepts

  • Concurrency
   • Multi Version Concurrency Control
   • Optimistic and Pessimistic models



                       Rubyfuza - Cape Town - 2012
MagLev Concepts

  • Concurrency
   • Multi Version Concurrency Control
   • Optimistic and Pessimistic models
  • Stores any Ruby Object

                       Rubyfuza - Cape Town - 2012
MagLev Concepts

  • Concurrency
   • Multi Version Concurrency Control
   • Optimistic and Pessimistic models
  • Stores any Ruby Object
   • including it’s code (methods)
                         Rubyfuza - Cape Town - 2012
Ruby
        VM


       Ruby
        VM    Shared
               Page    Repository
              Cache
Ruby
 VM


Ruby
 VM
Ruby
 VM


       Repository

Ruby
 VM
MagLev - Magic Hat




              Rubyfuza - Cape Town - 2012
MagLev - Magic Hat



  • Rabbit in Hat Trick


                      Rubyfuza - Cape Town - 2012
class Person
  attr_accessor :username, :followers

  def initialize(username)
    @username = username
    @followers = Array.new
  end

  def add_follower(person)
    @followers << person
  end

  def remove_follower(person)
    @followers.delete(person)
  end

  def to_s
    result = "@#{@username} --> [#{@followers.size}]"
    @followers.each {|f| result = result + " #{f.username}" }
    result
  end
end
                       Rubyfuza - Cape Town - 2012
class Person
  attr_accessor :username, :followers

  def initialize(username)
    @username = username
    @followers = Array.new
  end
  ...
end



               Rubyfuza - Cape Town - 2012
...
   def add_follower(person)
     @followers << person
   end

   def remove_follower(person)
     @followers.delete(person)
   end
...



                Rubyfuza - Cape Town - 2012
...
   def to_s
     result = "@#{@username} --> [#{@followers.size}]"
     @followers.each {|f| result = result + "
 #{f.username}" }
     result
   end
...




                     Rubyfuza - Cape Town - 2012
Maglev.persistent do
  require 'person'
end

Maglev::PERSISTENT_ROOT[:persons] = Array.new

Maglev.commit_transaction




                   Rubyfuza - Cape Town - 2012
person.rb
person.rb




person.rb
:persons

                 Array




  person.rb




person.rb
:persons

                 Array


                             :persons

                                        Array

  person.rb



                         person.rb
person.rb
persons = Maglev::PERSISTENT_ROOT[:persons]

persons.each {|p| puts p}




                Rubyfuza - Cape Town - 2012
require 'person'

dhh = Person.new("dhh")
obie = Person.new("obie")
unclebob = Person.new("unclebob")
noob1 = Person.new("noob1")
noob2 = Person.new("noob2")

dhh.add_follower(obie)
dhh.add_follower(unclebob)

obie.add_follower(unclebob)

unclebob.add_follower(noob1)
unclebob.add_follower(noob2)

persons = Maglev::PERSISTENT_ROOT[:persons]

persons << dhh
persons << obie
persons << unclebob

Maglev.commit_transaction
                               Rubyfuza - Cape Town - 2012
:persons

           Array


                   :persons

                              Array
:persons

             Array


dhh                  :persons

                                Array
:persons

              Array


dhh    obie           :persons

                                 Array
:persons

              Array


dhh    obie               :persons

               unclebob              Array
:persons

              Array


dhh    obie               :persons

               unclebob              Array
:persons

              Array


dhh    obie               :persons

               unclebob              Array
:persons

              Array


dhh    obie               :persons

               unclebob              Array
:persons

                Array


dhh      obie               :persons

                 unclebob              Array


      noob1
:persons

                Array


dhh      obie               :persons

                 unclebob              Array


      noob1     noob2
:persons

                Array


dhh      obie                 :persons

                 unclebob                    Array


      noob1                 dhh      obie
                noob2
                                              unclebob


                             noob1          noob2
TwitterClone2




                Rubyfuza - Cape Town - 2012
TwitterClone2


  • Improved design



                      Rubyfuza - Cape Town - 2012
TwitterClone2


  • Improved design
  • Multiple VM’s


                      Rubyfuza - Cape Town - 2012
TwitterClone2


  • Improved design
  • Multiple VM’s
  • Concurrent access - MVCC

                   Rubyfuza - Cape Town - 2012
TwitterClone2


  • Improved design
  • Multiple VM’s
  • Concurrent access - MVCC
  • First commit wins
                   Rubyfuza - Cape Town - 2012
class Person
  attr_accessor :username, :email, :followers,
                :following, :tweets

  def initialize(username)
    @username = username
    @email = username + “@email.com”
    @followers = Array.new
    @following = Array.new
    @tweets = Array.new
  end
  ...
end

                   Rubyfuza - Cape Town - 2012
...
   def follows(person)
     @following << person
     person.add_follower(self)
   end

   def unfollows(person)
     @following.delete(person)
     person.remove_follower(self)
   end
...


                    Rubyfuza - Cape Town - 2012
...
   def add_follower(person)
     @followers << person
   end

   def remove_follower(person)
     @followers.delete(person)
   end
...



                    Rubyfuza - Cape Town - 2012
...
   def tweets(text)
     @tweets << Tweet.new(self, text)
   end
...




                    Rubyfuza - Cape Town - 2012
...
    def to_s
      result = "@#{@username} tweeted #{@tweets.size} times, follows
 #{@following.size} persons and is followed #{@followers.size} times"
      result = result + " , following: {"
      @following.each {|f| result = result + " #{f.username}"}
      result = result + " }"
      result = result + " followed by: {"
      @followers.each {|f| result = result + " #{f.username}"}
      result = result + " }"
      result
    end
...




                              Rubyfuza - Cape Town - 2012
Maglev.persistent do
  require 'person'
  require 'tweet'
end

Maglev::PERSISTENT_ROOT[:persons] = Array.new

Maglev.commit_transaction



                   Rubyfuza - Cape Town - 2012
persons = Maglev::PERSISTENT_ROOT[:persons]

persons.each {|p| puts p}




                Rubyfuza - Cape Town - 2012
require 'person'

dhh = Person.new("dhh")
obie = Person.new("obie")
unclebob = Person.new("unclebob")
noob1 = Person.new("noob1")
noob2 = Person.new("noob2")

obie.follows(dhh)
unclebob.follows(dhh)

unclebob.follows(obie)

noob1.follows(unclebob)
noob2.follows(unclebob)

persons = Maglev::PERSISTENT_ROOT[:persons]

persons << dhh
persons << obie
persons << unclebob

Maglev.commit_transaction
                            Rubyfuza - Cape Town - 2012
dhh               obie
                       followers
                           dhh           followers
                                             obie
                       following         following



                                         unclebob
                                         followers
                                             dhh

Concurrent updates (in different VM’s)   following
        to same object fails
dhh               obie
                       followers
                           dhh           followers
                                             obie
                       following         following



                                         unclebob
                                         followers
                                             dhh

Concurrent updates (in different VM’s)   following
        to same object fails
:persons

                Array
                              dhh               obie
                              followers
                                  dhh           followers
                                                    obie
dhh      obie
                              following         following
                 unclebob


      noob1     noob2                           unclebob
                                                followers
                                                    dhh

       Concurrent updates (in different VM’s)   following
               to same object fails
:persons

                Array
                              dhh               obie
                              followers
                                  dhh           followers
                                                    obie
dhh      obie
                              following         following
                 unclebob


      noob1     noob2                           unclebob
                                                followers
                                                    dhh

       Concurrent updates (in different VM’s)   following
               to same object fails
:persons

                Array
                              dhh               obie
                              followers
                                  dhh           followers
                                                    obie
dhh      obie
                              following         following
                 unclebob


      noob1     noob2                           unclebob
                                                followers
                                                    dhh

       Concurrent updates (in different VM’s)   following
               to same object fails
:persons

                Array
                              dhh               obie
                              followers
                                  dhh           followers
                                                    obie
dhh      obie
                              following         following
                 unclebob


      noob1     noob2                           unclebob
                                                followers
                                                    dhh

       Concurrent updates (in different VM’s)   following
               to same object fails
MagLev - Locks




                 Rubyfuza - Cape Town - 2012
MagLev - Locks

  • Read lock on object



                    Rubyfuza - Cape Town - 2012
MagLev - Locks

  • Read lock on object
    •   Use object’s value and commit without fear that some other
        transaction has committed a new value for that object during
        your transaction




                            Rubyfuza - Cape Town - 2012
MagLev - Locks

  • Read lock on object
    •   Use object’s value and commit without fear that some other
        transaction has committed a new value for that object during
        your transaction
    •   Guarantees that other sessions cannot:
        a) acquire a write lock on the object
        b) commit if they have written the object


                            Rubyfuza - Cape Town - 2012
MagLev - Locks




                 Rubyfuza - Cape Town - 2012
MagLev - Locks

  • Write lock on object




                    Rubyfuza - Cape Town - 2012
MagLev - Locks

  • Write lock on object
    •   Guarantees that you can write the object and commit.




                           Rubyfuza - Cape Town - 2012
MagLev - Locks

  • Write lock on object
    •   Guarantees that you can write the object and commit.
    •   Guarantees that other sessions cannot:
        a) acquire a read or write lock on the object
        b) commit if they have written the object




                           Rubyfuza - Cape Town - 2012
MagLev - Locks

  • Write lock on object
    •   Guarantees that you can write the object and commit.
    •   Guarantees that other sessions cannot:
        a) acquire a read or write lock on the object
        b) commit if they have written the object
    •   Only one session can hold a write lock on an object - no
        other session can hold any kind of lock on the object.


                            Rubyfuza - Cape Town - 2012
MagLev - Procs


    y = 4
    proc = Proc.new {|x| x * y}
    proc.call(4)




                   Rubyfuza - Cape Town - 2012
MagLev - Continuation

  Thread.start { callcc {|cc| $cont = cc}; p “Run after
One pretty callcc” }

 Maglev::PERSISTENT_ROOT[:cc] = $cont

 Maglev.commit_transaction




                     Rubyfuza - Cape Town - 2012
MagLev - Continuation

 Maglev.abort_transaction

 $cont = Maglev::PERSISTENT_ROOT[:cc]

 Thread.start {$cont.call}




                    Rubyfuza - Cape Town - 2012
MagLev - Summary




             Rubyfuza - Cape Town - 2012
MagLev - Summary
  • Rabbit in hat trick




                      Rubyfuza - Cape Town - 2012
MagLev - Summary
  • Rabbit in hat trick
  • Concurrent access to objects in distributed VM’s




                     Rubyfuza - Cape Town - 2012
MagLev - Summary
  • Rabbit in hat trick
  • Concurrent access to objects in distributed VM’s
  • Proc’s can be persisted



                     Rubyfuza - Cape Town - 2012
MagLev - Summary
  • Rabbit in hat trick
  • Concurrent access to objects in distributed VM’s
  • Proc’s can be persisted
   • references enclosing environment’s variables


                         Rubyfuza - Cape Town - 2012
MagLev - Summary
  • Rabbit in hat trick
  • Concurrent access to objects in distributed VM’s
  • Proc’s can be persisted
   • references enclosing environment’s variables
  • Continuations

                         Rubyfuza - Cape Town - 2012
MagLev - Summary
  • Rabbit in hat trick
  • Concurrent access to objects in distributed VM’s
  • Proc’s can be persisted
   • references enclosing environment’s variables
  • Continuations
  • Queue
                         Rubyfuza - Cape Town - 2012
MagLev - Summary
  • Rabbit in hat trick
  • Concurrent access to objects in distributed VM’s
  • Proc’s can be persisted
   • references enclosing environment’s variables
  • Continuations
  • Queue
   • see example on github/maglev
                         Rubyfuza - Cape Town - 2012
Credits
 Monty Williams
 GemStone
 http://maglev.github.com/docs/learn.html
 https://github.com/MagLev/maglev

 Conrad Taylor
 Playing with Maglev the Ruby VM
 http://www.conradtaylor.com/2011/11/08/playing-with-maglev-the-
 ruby-vm/

 Tim Felgentreff
 Debugging on Steroids - what Ruby should learn from Smalltalk
 http://blog.bithug.org/2011/09/maglev-debug

                         Rubyfuza - Cape Town - 2012
Questions

  • Updates on Twitter                             @rudiengelbrecht


  • Slides on SlideShare
  •   Source code on GitHub                        userid - rle



                     Rubyfuza - Cape Town - 2012

More Related Content

Viewers also liked

Maglev Basic Introduction
Maglev Basic IntroductionMaglev Basic Introduction
Maglev Basic IntroductionBaba Fooka
 
Linear Motor In Maglev Train
Linear Motor In Maglev TrainLinear Motor In Maglev Train
Linear Motor In Maglev TrainEng_Ahmad
 
Magnetic levitation
Magnetic levitationMagnetic levitation
Magnetic levitationervivekdubey
 
Maglev Train Ppt 1
Maglev Train Ppt 1Maglev Train Ppt 1
Maglev Train Ppt 1shelly yadav
 

Viewers also liked (7)

Maglev train
Maglev trainMaglev train
Maglev train
 
Maglev Basic Introduction
Maglev Basic IntroductionMaglev Basic Introduction
Maglev Basic Introduction
 
Linear Motor In Maglev Train
Linear Motor In Maglev TrainLinear Motor In Maglev Train
Linear Motor In Maglev Train
 
Magnetic levitation
Magnetic levitationMagnetic levitation
Magnetic levitation
 
Maglev trains
Maglev trains Maglev trains
Maglev trains
 
Maglev Train Ppt 1
Maglev Train Ppt 1Maglev Train Ppt 1
Maglev Train Ppt 1
 
MAGLEV PPT
MAGLEV PPTMAGLEV PPT
MAGLEV PPT
 

Similar to Maglev Rubyfuza, Cape Town, 2012

Introduction to Ruby MagLev
Introduction to Ruby MagLevIntroduction to Ruby MagLev
Introduction to Ruby MagLevrengelbrecht
 
Your fist RubyMotion Application
Your fist RubyMotion ApplicationYour fist RubyMotion Application
Your fist RubyMotion Applicationtoamitkumar
 
RubyConfBD 2013 decouple, bundle and share with ruby gems
RubyConfBD 2013   decouple, bundle and share with ruby gems RubyConfBD 2013   decouple, bundle and share with ruby gems
RubyConfBD 2013 decouple, bundle and share with ruby gems nhm taveer hossain khan
 
Opal - Ruby Style!! Ruby in the browser
Opal - Ruby Style!!  Ruby in the browserOpal - Ruby Style!!  Ruby in the browser
Opal - Ruby Style!! Ruby in the browserForrest Chang
 
Ruby for C#-ers (ScanDevConf 2010)
Ruby for C#-ers (ScanDevConf 2010)Ruby for C#-ers (ScanDevConf 2010)
Ruby for C#-ers (ScanDevConf 2010)Thomas Lundström
 
Freelancing and side-projects on Rails
Freelancing and side-projects on RailsFreelancing and side-projects on Rails
Freelancing and side-projects on RailsJohn McCaffrey
 
Introduction to ArangoDB (nosql matters Barcelona 2012)
Introduction to ArangoDB (nosql matters Barcelona 2012)Introduction to ArangoDB (nosql matters Barcelona 2012)
Introduction to ArangoDB (nosql matters Barcelona 2012)ArangoDB Database
 
Merb presentation at ORUG
Merb presentation at ORUGMerb presentation at ORUG
Merb presentation at ORUGMatt Aimonetti
 
Introducing ruby on rails
Introducing ruby on railsIntroducing ruby on rails
Introducing ruby on railsPriceen
 
High Performance Ruby: Evented vs. Threaded
High Performance Ruby: Evented vs. ThreadedHigh Performance Ruby: Evented vs. Threaded
High Performance Ruby: Evented vs. ThreadedEngine Yard
 
Crate - ruby based standalone executables
Crate - ruby based standalone executablesCrate - ruby based standalone executables
Crate - ruby based standalone executablesJeremy Hinegardner
 
Learn Ruby 2011 - Session 1
Learn Ruby 2011 - Session 1Learn Ruby 2011 - Session 1
Learn Ruby 2011 - Session 1James Thompson
 

Similar to Maglev Rubyfuza, Cape Town, 2012 (20)

Introduction to Ruby MagLev
Introduction to Ruby MagLevIntroduction to Ruby MagLev
Introduction to Ruby MagLev
 
Your fist RubyMotion Application
Your fist RubyMotion ApplicationYour fist RubyMotion Application
Your fist RubyMotion Application
 
Why ruby
Why rubyWhy ruby
Why ruby
 
IJTC%202009%20JRuby
IJTC%202009%20JRubyIJTC%202009%20JRuby
IJTC%202009%20JRuby
 
IJTC%202009%20JRuby
IJTC%202009%20JRubyIJTC%202009%20JRuby
IJTC%202009%20JRuby
 
RubyConfBD 2013 decouple, bundle and share with ruby gems
RubyConfBD 2013   decouple, bundle and share with ruby gems RubyConfBD 2013   decouple, bundle and share with ruby gems
RubyConfBD 2013 decouple, bundle and share with ruby gems
 
Opal - Ruby Style!! Ruby in the browser
Opal - Ruby Style!!  Ruby in the browserOpal - Ruby Style!!  Ruby in the browser
Opal - Ruby Style!! Ruby in the browser
 
Ruby for C#-ers (ScanDevConf 2010)
Ruby for C#-ers (ScanDevConf 2010)Ruby for C#-ers (ScanDevConf 2010)
Ruby for C#-ers (ScanDevConf 2010)
 
Forget The ORM!
Forget The ORM!Forget The ORM!
Forget The ORM!
 
My way with Ruby
My way with RubyMy way with Ruby
My way with Ruby
 
Freelancing and side-projects on Rails
Freelancing and side-projects on RailsFreelancing and side-projects on Rails
Freelancing and side-projects on Rails
 
Introduction to ArangoDB (nosql matters Barcelona 2012)
Introduction to ArangoDB (nosql matters Barcelona 2012)Introduction to ArangoDB (nosql matters Barcelona 2012)
Introduction to ArangoDB (nosql matters Barcelona 2012)
 
Merb presentation at ORUG
Merb presentation at ORUGMerb presentation at ORUG
Merb presentation at ORUG
 
Introducing ruby on rails
Introducing ruby on railsIntroducing ruby on rails
Introducing ruby on rails
 
Os Bunce
Os BunceOs Bunce
Os Bunce
 
Let's Get to the Rapids
Let's Get to the RapidsLet's Get to the Rapids
Let's Get to the Rapids
 
High Performance Ruby: Evented vs. Threaded
High Performance Ruby: Evented vs. ThreadedHigh Performance Ruby: Evented vs. Threaded
High Performance Ruby: Evented vs. Threaded
 
Crate - ruby based standalone executables
Crate - ruby based standalone executablesCrate - ruby based standalone executables
Crate - ruby based standalone executables
 
Learn Ruby 2011 - Session 1
Learn Ruby 2011 - Session 1Learn Ruby 2011 - Session 1
Learn Ruby 2011 - Session 1
 
LWP + libcurl
LWP + libcurlLWP + libcurl
LWP + libcurl
 

Recently uploaded

5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)Mazie Garcia
 
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's Jewel
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's JewelSicily Holidays Guide Book: Unveiling the Treasures of Italy's Jewel
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's JewelTime for Sicily
 
Aeromexico Airlines Flight Name Change Policy
Aeromexico Airlines Flight Name Change PolicyAeromexico Airlines Flight Name Change Policy
Aeromexico Airlines Flight Name Change PolicyFlyFairTravels
 
Hoi An Ancient Town, Vietnam (越南 會安古鎮).ppsx
Hoi An Ancient Town, Vietnam (越南 會安古鎮).ppsxHoi An Ancient Town, Vietnam (越南 會安古鎮).ppsx
Hoi An Ancient Town, Vietnam (越南 會安古鎮).ppsxChung Yen Chang
 
Where to Stay in Lagos, Portugal.pptxasd
Where to Stay in Lagos, Portugal.pptxasdWhere to Stay in Lagos, Portugal.pptxasd
Where to Stay in Lagos, Portugal.pptxasdusmanghaniwixpatriot
 
Haitian culture and stuff and places and food and travel.pptx
Haitian culture and stuff and places and food and travel.pptxHaitian culture and stuff and places and food and travel.pptx
Haitian culture and stuff and places and food and travel.pptxhxhlixia
 
Moroccan Architecture presentation ( Omar & Yasine ).pptx
Moroccan Architecture presentation ( Omar & Yasine ).pptxMoroccan Architecture presentation ( Omar & Yasine ).pptx
Moroccan Architecture presentation ( Omar & Yasine ).pptxOmarOuazzani1
 
Inspirational Quotes About Italy and Food
Inspirational Quotes About Italy and FoodInspirational Quotes About Italy and Food
Inspirational Quotes About Italy and FoodKasia Chojecki
 
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)Escort Service
 
question 2: airplane vocabulary presentation
question 2: airplane vocabulary presentationquestion 2: airplane vocabulary presentation
question 2: airplane vocabulary presentationcaminantesdaauga
 
a presentation for foreigners about how to travel in Germany.
a presentation for foreigners about how to travel in Germany.a presentation for foreigners about how to travel in Germany.
a presentation for foreigners about how to travel in Germany.moritzmieg
 
How Safe Is It To Witness Whales In Maui’s Waters
How Safe Is It To Witness Whales In Maui’s WatersHow Safe Is It To Witness Whales In Maui’s Waters
How Safe Is It To Witness Whales In Maui’s WatersMakena Coast Charters
 
Authentic Travel Experience 2024 Greg DeShields.pptx
Authentic Travel Experience 2024 Greg DeShields.pptxAuthentic Travel Experience 2024 Greg DeShields.pptx
Authentic Travel Experience 2024 Greg DeShields.pptxGregory DeShields
 
Revolutionalizing Travel: A VacAI Update
Revolutionalizing Travel: A VacAI UpdateRevolutionalizing Travel: A VacAI Update
Revolutionalizing Travel: A VacAI Updatejoymorrison10
 
Italia Lucca 1 Un tesoro nascosto tra le sue mura
Italia Lucca 1 Un tesoro nascosto tra le sue muraItalia Lucca 1 Un tesoro nascosto tra le sue mura
Italia Lucca 1 Un tesoro nascosto tra le sue murasandamichaela *
 

Recently uploaded (17)

5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
 
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's Jewel
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's JewelSicily Holidays Guide Book: Unveiling the Treasures of Italy's Jewel
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's Jewel
 
Aeromexico Airlines Flight Name Change Policy
Aeromexico Airlines Flight Name Change PolicyAeromexico Airlines Flight Name Change Policy
Aeromexico Airlines Flight Name Change Policy
 
Hoi An Ancient Town, Vietnam (越南 會安古鎮).ppsx
Hoi An Ancient Town, Vietnam (越南 會安古鎮).ppsxHoi An Ancient Town, Vietnam (越南 會安古鎮).ppsx
Hoi An Ancient Town, Vietnam (越南 會安古鎮).ppsx
 
Where to Stay in Lagos, Portugal.pptxasd
Where to Stay in Lagos, Portugal.pptxasdWhere to Stay in Lagos, Portugal.pptxasd
Where to Stay in Lagos, Portugal.pptxasd
 
Haitian culture and stuff and places and food and travel.pptx
Haitian culture and stuff and places and food and travel.pptxHaitian culture and stuff and places and food and travel.pptx
Haitian culture and stuff and places and food and travel.pptx
 
Moroccan Architecture presentation ( Omar & Yasine ).pptx
Moroccan Architecture presentation ( Omar & Yasine ).pptxMoroccan Architecture presentation ( Omar & Yasine ).pptx
Moroccan Architecture presentation ( Omar & Yasine ).pptx
 
Inspirational Quotes About Italy and Food
Inspirational Quotes About Italy and FoodInspirational Quotes About Italy and Food
Inspirational Quotes About Italy and Food
 
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)
 
question 2: airplane vocabulary presentation
question 2: airplane vocabulary presentationquestion 2: airplane vocabulary presentation
question 2: airplane vocabulary presentation
 
a presentation for foreigners about how to travel in Germany.
a presentation for foreigners about how to travel in Germany.a presentation for foreigners about how to travel in Germany.
a presentation for foreigners about how to travel in Germany.
 
How Safe Is It To Witness Whales In Maui’s Waters
How Safe Is It To Witness Whales In Maui’s WatersHow Safe Is It To Witness Whales In Maui’s Waters
How Safe Is It To Witness Whales In Maui’s Waters
 
Enjoy ➥8448380779▻ Call Girls In Sector 62 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 62 Noida Escorts Delhi NCREnjoy ➥8448380779▻ Call Girls In Sector 62 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 62 Noida Escorts Delhi NCR
 
Authentic Travel Experience 2024 Greg DeShields.pptx
Authentic Travel Experience 2024 Greg DeShields.pptxAuthentic Travel Experience 2024 Greg DeShields.pptx
Authentic Travel Experience 2024 Greg DeShields.pptx
 
Revolutionalizing Travel: A VacAI Update
Revolutionalizing Travel: A VacAI UpdateRevolutionalizing Travel: A VacAI Update
Revolutionalizing Travel: A VacAI Update
 
Enjoy ➥8448380779▻ Call Girls In Sector 74 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 74 Noida Escorts Delhi NCREnjoy ➥8448380779▻ Call Girls In Sector 74 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 74 Noida Escorts Delhi NCR
 
Italia Lucca 1 Un tesoro nascosto tra le sue mura
Italia Lucca 1 Un tesoro nascosto tra le sue muraItalia Lucca 1 Un tesoro nascosto tra le sue mura
Italia Lucca 1 Un tesoro nascosto tra le sue mura
 

Maglev Rubyfuza, Cape Town, 2012

  • 1. Exploring Maglev Rudi Engelbrecht Rubyfuza, Cape Town, 2-3 Feb 2012 lautus
  • 2. MagLev History Rubyfuza - Cape Town - 2012
  • 3. MagLev History • Smalltalk Virtual Machine Rubyfuza - Cape Town - 2012
  • 4. MagLev History • Smalltalk Virtual Machine • Mature, used in production, large sites Rubyfuza - Cape Town - 2012
  • 5. MagLev History • Smalltalk Virtual Machine • Mature, used in production, large sites • GemStone Rubyfuza - Cape Town - 2012
  • 6. MagLev History • Smalltalk Virtual Machine • Mature, used in production, large sites • GemStone • Transactional Memory Object Server for Smalltalk Rubyfuza - Cape Town - 2012
  • 7. MagLev History • Smalltalk Virtual Machine • Mature, used in production, large sites • GemStone • Transactional Memory Object Server for Smalltalk • Maglev Rubyfuza - Cape Town - 2012
  • 8. MagLev History • Smalltalk Virtual Machine • Mature, used in production, large sites • GemStone • Transactional Memory Object Server for Smalltalk • Maglev • Transactional Memory Object Server for Ruby Rubyfuza - Cape Town - 2012
  • 9. MagLev Concepts Rubyfuza - Cape Town - 2012
  • 10. MagLev Concepts • Root Object Rubyfuza - Cape Town - 2012
  • 11. MagLev Concepts • Root Object • Persistency by Reachability Rubyfuza - Cape Town - 2012
  • 12. MagLev Concepts • Root Object • Persistency by Reachability • transitive closure Rubyfuza - Cape Town - 2012
  • 13. MagLev Concepts • Root Object • Persistency by Reachability • transitive closure • Repository Rubyfuza - Cape Town - 2012
  • 14. MagLev Concepts • Root Object • Persistency by Reachability • transitive closure • Repository • Ruby Virtual Machines Rubyfuza - Cape Town - 2012
  • 15. MagLev Concepts • Root Object • Persistency by Reachability • transitive closure • Repository • Ruby Virtual Machines • local vs remote virtual machines Rubyfuza - Cape Town - 2012
  • 16. MagLev Concepts • Root Object • Persistency by Reachability • transitive closure • Repository • Ruby Virtual Machines • local vs remote virtual machines • Garbage Collector Rubyfuza - Cape Town - 2012
  • 17. MagLev Concepts Rubyfuza - Cape Town - 2012
  • 18. MagLev Concepts • Transparent Object Persistence Rubyfuza - Cape Town - 2012
  • 19. MagLev Concepts • Transparent Object Persistence • Large Object Space Rubyfuza - Cape Town - 2012
  • 20. MagLev Concepts • Transparent Object Persistence • Large Object Space • limited by disk space (not RAM) Rubyfuza - Cape Town - 2012
  • 21. MagLev Concepts • Transparent Object Persistence • Large Object Space • limited by disk space (not RAM) • Multi-user Rubyfuza - Cape Town - 2012
  • 22. MagLev Concepts • Transparent Object Persistence • Large Object Space • limited by disk space (not RAM) • Multi-user • Thousands of virtual machines Rubyfuza - Cape Town - 2012
  • 23. MagLev Concepts • Transparent Object Persistence • Large Object Space • limited by disk space (not RAM) • Multi-user • Thousands of virtual machines • Sharing one object space Rubyfuza - Cape Town - 2012
  • 24. MagLev Concepts • Transparent Object Persistence • Large Object Space • limited by disk space (not RAM) • Multi-user • Thousands of virtual machines • Sharing one object space • Isolation of each user’s view (repeatable read) Rubyfuza - Cape Town - 2012
  • 25. MagLev Concepts Rubyfuza - Cape Town - 2012
  • 26. MagLev Concepts • Concurrency Rubyfuza - Cape Town - 2012
  • 27. MagLev Concepts • Concurrency • Multi Version Concurrency Control Rubyfuza - Cape Town - 2012
  • 28. MagLev Concepts • Concurrency • Multi Version Concurrency Control • Optimistic and Pessimistic models Rubyfuza - Cape Town - 2012
  • 29. MagLev Concepts • Concurrency • Multi Version Concurrency Control • Optimistic and Pessimistic models • Stores any Ruby Object Rubyfuza - Cape Town - 2012
  • 30. MagLev Concepts • Concurrency • Multi Version Concurrency Control • Optimistic and Pessimistic models • Stores any Ruby Object • including it’s code (methods) Rubyfuza - Cape Town - 2012
  • 31. Ruby VM Ruby VM Shared Page Repository Cache Ruby VM Ruby VM
  • 32. Ruby VM Repository Ruby VM
  • 33. MagLev - Magic Hat Rubyfuza - Cape Town - 2012
  • 34. MagLev - Magic Hat • Rabbit in Hat Trick Rubyfuza - Cape Town - 2012
  • 35. class Person attr_accessor :username, :followers def initialize(username) @username = username @followers = Array.new end def add_follower(person) @followers << person end def remove_follower(person) @followers.delete(person) end def to_s result = "@#{@username} --> [#{@followers.size}]" @followers.each {|f| result = result + " #{f.username}" } result end end Rubyfuza - Cape Town - 2012
  • 36. class Person attr_accessor :username, :followers def initialize(username) @username = username @followers = Array.new end ... end Rubyfuza - Cape Town - 2012
  • 37. ... def add_follower(person) @followers << person end def remove_follower(person) @followers.delete(person) end ... Rubyfuza - Cape Town - 2012
  • 38. ... def to_s result = "@#{@username} --> [#{@followers.size}]" @followers.each {|f| result = result + " #{f.username}" } result end ... Rubyfuza - Cape Town - 2012
  • 39. Maglev.persistent do require 'person' end Maglev::PERSISTENT_ROOT[:persons] = Array.new Maglev.commit_transaction Rubyfuza - Cape Town - 2012
  • 40.
  • 41.
  • 42.
  • 45. :persons Array person.rb person.rb
  • 46. :persons Array :persons Array person.rb person.rb person.rb
  • 47. persons = Maglev::PERSISTENT_ROOT[:persons] persons.each {|p| puts p} Rubyfuza - Cape Town - 2012
  • 48. require 'person' dhh = Person.new("dhh") obie = Person.new("obie") unclebob = Person.new("unclebob") noob1 = Person.new("noob1") noob2 = Person.new("noob2") dhh.add_follower(obie) dhh.add_follower(unclebob) obie.add_follower(unclebob) unclebob.add_follower(noob1) unclebob.add_follower(noob2) persons = Maglev::PERSISTENT_ROOT[:persons] persons << dhh persons << obie persons << unclebob Maglev.commit_transaction Rubyfuza - Cape Town - 2012
  • 49.
  • 50.
  • 51.
  • 52. :persons Array :persons Array
  • 53. :persons Array dhh :persons Array
  • 54. :persons Array dhh obie :persons Array
  • 55. :persons Array dhh obie :persons unclebob Array
  • 56. :persons Array dhh obie :persons unclebob Array
  • 57. :persons Array dhh obie :persons unclebob Array
  • 58. :persons Array dhh obie :persons unclebob Array
  • 59. :persons Array dhh obie :persons unclebob Array noob1
  • 60. :persons Array dhh obie :persons unclebob Array noob1 noob2
  • 61. :persons Array dhh obie :persons unclebob Array noob1 dhh obie noob2 unclebob noob1 noob2
  • 62. TwitterClone2 Rubyfuza - Cape Town - 2012
  • 63. TwitterClone2 • Improved design Rubyfuza - Cape Town - 2012
  • 64. TwitterClone2 • Improved design • Multiple VM’s Rubyfuza - Cape Town - 2012
  • 65. TwitterClone2 • Improved design • Multiple VM’s • Concurrent access - MVCC Rubyfuza - Cape Town - 2012
  • 66. TwitterClone2 • Improved design • Multiple VM’s • Concurrent access - MVCC • First commit wins Rubyfuza - Cape Town - 2012
  • 67. class Person attr_accessor :username, :email, :followers, :following, :tweets def initialize(username) @username = username @email = username + “@email.com” @followers = Array.new @following = Array.new @tweets = Array.new end ... end Rubyfuza - Cape Town - 2012
  • 68. ... def follows(person) @following << person person.add_follower(self) end def unfollows(person) @following.delete(person) person.remove_follower(self) end ... Rubyfuza - Cape Town - 2012
  • 69. ... def add_follower(person) @followers << person end def remove_follower(person) @followers.delete(person) end ... Rubyfuza - Cape Town - 2012
  • 70. ... def tweets(text) @tweets << Tweet.new(self, text) end ... Rubyfuza - Cape Town - 2012
  • 71. ... def to_s result = "@#{@username} tweeted #{@tweets.size} times, follows #{@following.size} persons and is followed #{@followers.size} times" result = result + " , following: {" @following.each {|f| result = result + " #{f.username}"} result = result + " }" result = result + " followed by: {" @followers.each {|f| result = result + " #{f.username}"} result = result + " }" result end ... Rubyfuza - Cape Town - 2012
  • 72. Maglev.persistent do require 'person' require 'tweet' end Maglev::PERSISTENT_ROOT[:persons] = Array.new Maglev.commit_transaction Rubyfuza - Cape Town - 2012
  • 73. persons = Maglev::PERSISTENT_ROOT[:persons] persons.each {|p| puts p} Rubyfuza - Cape Town - 2012
  • 74. require 'person' dhh = Person.new("dhh") obie = Person.new("obie") unclebob = Person.new("unclebob") noob1 = Person.new("noob1") noob2 = Person.new("noob2") obie.follows(dhh) unclebob.follows(dhh) unclebob.follows(obie) noob1.follows(unclebob) noob2.follows(unclebob) persons = Maglev::PERSISTENT_ROOT[:persons] persons << dhh persons << obie persons << unclebob Maglev.commit_transaction Rubyfuza - Cape Town - 2012
  • 75. dhh obie followers dhh followers obie following following unclebob followers dhh Concurrent updates (in different VM’s) following to same object fails
  • 76. dhh obie followers dhh followers obie following following unclebob followers dhh Concurrent updates (in different VM’s) following to same object fails
  • 77. :persons Array dhh obie followers dhh followers obie dhh obie following following unclebob noob1 noob2 unclebob followers dhh Concurrent updates (in different VM’s) following to same object fails
  • 78. :persons Array dhh obie followers dhh followers obie dhh obie following following unclebob noob1 noob2 unclebob followers dhh Concurrent updates (in different VM’s) following to same object fails
  • 79. :persons Array dhh obie followers dhh followers obie dhh obie following following unclebob noob1 noob2 unclebob followers dhh Concurrent updates (in different VM’s) following to same object fails
  • 80. :persons Array dhh obie followers dhh followers obie dhh obie following following unclebob noob1 noob2 unclebob followers dhh Concurrent updates (in different VM’s) following to same object fails
  • 81. MagLev - Locks Rubyfuza - Cape Town - 2012
  • 82. MagLev - Locks • Read lock on object Rubyfuza - Cape Town - 2012
  • 83. MagLev - Locks • Read lock on object • Use object’s value and commit without fear that some other transaction has committed a new value for that object during your transaction Rubyfuza - Cape Town - 2012
  • 84. MagLev - Locks • Read lock on object • Use object’s value and commit without fear that some other transaction has committed a new value for that object during your transaction • Guarantees that other sessions cannot: a) acquire a write lock on the object b) commit if they have written the object Rubyfuza - Cape Town - 2012
  • 85. MagLev - Locks Rubyfuza - Cape Town - 2012
  • 86. MagLev - Locks • Write lock on object Rubyfuza - Cape Town - 2012
  • 87. MagLev - Locks • Write lock on object • Guarantees that you can write the object and commit. Rubyfuza - Cape Town - 2012
  • 88. MagLev - Locks • Write lock on object • Guarantees that you can write the object and commit. • Guarantees that other sessions cannot: a) acquire a read or write lock on the object b) commit if they have written the object Rubyfuza - Cape Town - 2012
  • 89. MagLev - Locks • Write lock on object • Guarantees that you can write the object and commit. • Guarantees that other sessions cannot: a) acquire a read or write lock on the object b) commit if they have written the object • Only one session can hold a write lock on an object - no other session can hold any kind of lock on the object. Rubyfuza - Cape Town - 2012
  • 90. MagLev - Procs y = 4 proc = Proc.new {|x| x * y} proc.call(4) Rubyfuza - Cape Town - 2012
  • 91. MagLev - Continuation Thread.start { callcc {|cc| $cont = cc}; p “Run after One pretty callcc” } Maglev::PERSISTENT_ROOT[:cc] = $cont Maglev.commit_transaction Rubyfuza - Cape Town - 2012
  • 92. MagLev - Continuation Maglev.abort_transaction $cont = Maglev::PERSISTENT_ROOT[:cc] Thread.start {$cont.call} Rubyfuza - Cape Town - 2012
  • 93. MagLev - Summary Rubyfuza - Cape Town - 2012
  • 94. MagLev - Summary • Rabbit in hat trick Rubyfuza - Cape Town - 2012
  • 95. MagLev - Summary • Rabbit in hat trick • Concurrent access to objects in distributed VM’s Rubyfuza - Cape Town - 2012
  • 96. MagLev - Summary • Rabbit in hat trick • Concurrent access to objects in distributed VM’s • Proc’s can be persisted Rubyfuza - Cape Town - 2012
  • 97. MagLev - Summary • Rabbit in hat trick • Concurrent access to objects in distributed VM’s • Proc’s can be persisted • references enclosing environment’s variables Rubyfuza - Cape Town - 2012
  • 98. MagLev - Summary • Rabbit in hat trick • Concurrent access to objects in distributed VM’s • Proc’s can be persisted • references enclosing environment’s variables • Continuations Rubyfuza - Cape Town - 2012
  • 99. MagLev - Summary • Rabbit in hat trick • Concurrent access to objects in distributed VM’s • Proc’s can be persisted • references enclosing environment’s variables • Continuations • Queue Rubyfuza - Cape Town - 2012
  • 100. MagLev - Summary • Rabbit in hat trick • Concurrent access to objects in distributed VM’s • Proc’s can be persisted • references enclosing environment’s variables • Continuations • Queue • see example on github/maglev Rubyfuza - Cape Town - 2012
  • 101. Credits Monty Williams GemStone http://maglev.github.com/docs/learn.html https://github.com/MagLev/maglev Conrad Taylor Playing with Maglev the Ruby VM http://www.conradtaylor.com/2011/11/08/playing-with-maglev-the- ruby-vm/ Tim Felgentreff Debugging on Steroids - what Ruby should learn from Smalltalk http://blog.bithug.org/2011/09/maglev-debug Rubyfuza - Cape Town - 2012
  • 102. Questions • Updates on Twitter @rudiengelbrecht • Slides on SlideShare • Source code on GitHub userid - rle Rubyfuza - Cape Town - 2012

Editor's Notes

  1. \n
  2. gcgem\n
  3. gcgem\n
  4. gcgem\n
  5. gcgem\n
  6. gcgem\n
  7. gcgem\n
  8. gcgem\n
  9. gcgem\n
  10. gcgem\n
  11. gcgem\n
  12. gcgem\n
  13. gcgem\n
  14. gcgem\n
  15. gcgem\n
  16. gcgem\n
  17. gcgem\n
  18. gcgem\n
  19. gcgem\n
  20. gcgem\n
  21. gcgem\n
  22. Consistency levels\nDegree 0 - None\nDegree 1 - Locking READ UNCOMMITTED\nDegree 2 - Locking READ COMMITTED\nLocking REPEATABLE READ\nDegree 3 - Locking SERIALIZABLE\n
  23. Consistency levels\nDegree 0 - None\nDegree 1 - Locking READ UNCOMMITTED\nDegree 2 - Locking READ COMMITTED\nLocking REPEATABLE READ\nDegree 3 - Locking SERIALIZABLE\n
  24. Consistency levels\nDegree 0 - None\nDegree 1 - Locking READ UNCOMMITTED\nDegree 2 - Locking READ COMMITTED\nLocking REPEATABLE READ\nDegree 3 - Locking SERIALIZABLE\n
  25. Consistency levels\nDegree 0 - None\nDegree 1 - Locking READ UNCOMMITTED\nDegree 2 - Locking READ COMMITTED\nLocking REPEATABLE READ\nDegree 3 - Locking SERIALIZABLE\n
  26. Consistency levels\nDegree 0 - None\nDegree 1 - Locking READ UNCOMMITTED\nDegree 2 - Locking READ COMMITTED\nLocking REPEATABLE READ\nDegree 3 - Locking SERIALIZABLE\n
  27. Logical Architecture\n
  28. Demonstration architecture\nRoot object - carrot orange\n
  29. show hat, rabbit and cat\n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. owynn = Person.new(&quot;Owynn&quot;)\nunclebob = persons[0].followers[1]\nunclebob.add_follower(owynn)\n
  52. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  53. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  54. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  55. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  56. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  57. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  58. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  59. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  60. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  61. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  62. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  63. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  64. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  65. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  66. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  67. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  68. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  69. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  70. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  71. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  72. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  73. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  74. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  75. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  76. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  77. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  78. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  79. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  80. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  81. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  82. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  83. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  84. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  85. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  86. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  87. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  88. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  89. note the persistence by reachability\ncould also just add dhh\nshow persons[0].followers[0].followers[0].followers[1] is the reference to noob2\nalso persons[0].followers[1].followers[1] is reference to noob2\n
  90. \n
  91. \n
  92. \n
  93. \n
  94. New design has following attribute - extra relation, bi-directional\nAlso a list of tweets\n
  95. \n
  96. \n
  97. \n
  98. \n
  99. \n
  100. \n
  101. The new API is follows(person) instead of add_follower(person)\nowynn = Person.new(&quot;Owynn&quot;)\nunclebob = persons[0].followers[1]\nowynn.follows(unclebob) instead of below\nunclebob.add_follower(owynn)\n
  102. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  103. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  104. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  105. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  106. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  107. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  108. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  109. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  110. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  111. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  112. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  113. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  114. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  115. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  116. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  117. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  118. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  119. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  120. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  121. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  122. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  123. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  124. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  125. To understand the utility of read locks, imagine that you need to compute the average age of a large number of employees. While you are reading the employees and computing the average, another user changes an employee&amp;#x2019;s age and commits (in the aftermath of the birthday party). You have now performed the computation using out-of-date information. You can prevent this frustration by read-locking the employees at the outset of your transaction; this prevents changes to those objects.\nNOTEIf you have a read lock on an object and you try to write that object, your attempt to commit that transaction will fail. \n
  126. To understand the utility of read locks, imagine that you need to compute the average age of a large number of employees. While you are reading the employees and computing the average, another user changes an employee&amp;#x2019;s age and commits (in the aftermath of the birthday party). You have now performed the computation using out-of-date information. You can prevent this frustration by read-locking the employees at the outset of your transaction; this prevents changes to those objects.\nNOTEIf you have a read lock on an object and you try to write that object, your attempt to commit that transaction will fail. \n
  127. To understand the utility of read locks, imagine that you need to compute the average age of a large number of employees. While you are reading the employees and computing the average, another user changes an employee&amp;#x2019;s age and commits (in the aftermath of the birthday party). You have now performed the computation using out-of-date information. You can prevent this frustration by read-locking the employees at the outset of your transaction; this prevents changes to those objects.\nNOTEIf you have a read lock on an object and you try to write that object, your attempt to commit that transaction will fail. \n
  128. Write locks are useful, for example, if you want to change the addresses of a number of employees. If you write-lock the employees at the outset of your transaction, you prevent other sessions from modifying one of the employees and committing before you can finish your work. This guarantees your ability to commit the changes.\n
  129. Write locks are useful, for example, if you want to change the addresses of a number of employees. If you write-lock the employees at the outset of your transaction, you prevent other sessions from modifying one of the employees and committing before you can finish your work. This guarantees your ability to commit the changes.\n
  130. Write locks are useful, for example, if you want to change the addresses of a number of employees. If you write-lock the employees at the outset of your transaction, you prevent other sessions from modifying one of the employees and committing before you can finish your work. This guarantees your ability to commit the changes.\n
  131. Write locks are useful, for example, if you want to change the addresses of a number of employees. If you write-lock the employees at the outset of your transaction, you prevent other sessions from modifying one of the employees and committing before you can finish your work. This guarantees your ability to commit the changes.\n
  132. create in one vm\nexecute in another vm\nhttp://maglev.github.com/docs/learn.html\n
  133. create in one vm\nexecute in another vm\nFull credit to Monty / GemStone - see URL\nhttp://maglev.github.com/docs/learn.html\n\nThreads cannot be persisted by reference (because the JIT may have have compile methods to machine code, which cannot be ported across VMs), but we can use a trick.\nWhat did we do here? Well, we started a thread and created a continuation. A continuation captures the state of a computation, effectively copying the stack at the point it was created (We can see in the inspection output that the continuation has a reference to a copy of the Thread that created it). We assign the continuation to a global variable for convenience, and then commit it to the Stone repository.\n\n
  134. create in one vm\nexecute in another vm\nFull credit to Monty / GemStone - see URL\nhttp://maglev.github.com/docs/learn.html\n
  135. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  136. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  137. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  138. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  139. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  140. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  141. abort transaction\nchange username and refresh in 2nd vm\nnot same as just returning cached instance in vm like other ORM&amp;#x2019;s\n
  142. \n
  143. \n