SlideShare ist ein Scribd-Unternehmen logo
1 von 37
Ruby 1.9.3
                        GVL
                                           Fujitsu




Sunday, July 17, 2011
Who am I?




Sunday, July 17, 2011
•

                    •       IO   OS



                    • usa




Sunday, July 17, 2011
at Linux Kernel
                         Summit 2010


Sunday, July 17, 2011
Shyouhei commiter ranking




                                                me!




Sunday, July 17, 2011
Sunday, July 17, 2011
Sunday, July 17, 2011
GVL




Sunday, July 17, 2011
What’s GVL
                    • Global(or Giant) VM Lock
                    •

                    •             multi thread issue   Ruby script



                    •                      CPU



                    • Python


Sunday, July 17, 2011
What’s GVL (cont.)

                    • GVL


                    •        GVL



                    • OS


Sunday, July 17, 2011
f = false

                        Thread.new {

                            ....;

                            f = true

                        }

                        Thread.pass until f


Sunday, July 17, 2011
GVL design
                    • Lock
                            wait                             (e.g. write)



                    • lock, unlock

                                             Python, QEMU,    Linux



                    • GVL acquire/release
                        pthread_mutex_{lock,unlock}

Sunday, July 17, 2011
GVL design (cont.)
                    •


                    •




Sunday, July 17, 2011
GVL design (cont.)
                •       ON            if (th->interrupt_flag) {

                                          gvl_release();

                                          sched_yield();

                                          gvl_acquire();

                                      }




Sunday, July 17, 2011
•              OSS            while (true) {
                               (         )          lock();
                                                    if (hoge) {
                                                       unlock();
                                                       break;
                    •                               }
                                                    unlock();
                    • thread             lock       rep_nop();
                                                  }
                                         hoge=1
                                                  lock();
                                                  hoge = 1;
                                                  unlock();
Sunday, July 17, 2011
Why?




Sunday, July 17, 2011
CPU


                          cpu1        cpu2

        memory          core core   core core   memory
          1                                       2
                        core core   core core




Sunday, July 17, 2011
if (th->interrupt_flag) {

                                      gvl_release();

                                      sched_yield();

                                      gvl_acquire();

                                  }


          •gvl_release() gvl_acquire()                       sched_yield()


          •             sched_yield()                    yield


Sunday, July 17, 2011
sched_yield
                    • Unix                               API
                             http://pubs.opengroup.org/onlinepubs/009695399/
                             functions/sched_yield.html


                             int sched_yield(void);

                             • The sched_yield() function shall force the
                               running thread to relinquish the processor
                               until it again becomes the head of its
                               thread list.


                    •




Sunday, July 17, 2011
Thread
                core


                                 Thread   Thread   Thread
                        Thread
                  core



                        Thread
                  core

Sunday, July 17, 2011
(ry
                                          CPU


                        Thread
                core             Thread     Thread



                        Thread
                  core           Thread



                        Thread
                  core           Thread

Sunday, July 17, 2011
Yield!


                           Ruby
                          Thread

                core               Thread



                          Thread
                  core              Ruby
                                   Thread




Sunday, July 17, 2011
thread list
                                          head

                        Thread
                core              Ruby
                                 Thread




                        Thread
                  core            Ruby
                                 Thread




Sunday, July 17, 2011
Ruby
                        Thread

                core             Thread



                        Thread
                  core            Ruby
                                 Thread




        POSIX


Sunday, July 17, 2011
CFS yield
                    • Linux    RHEL5   RHEL6



                    • RHEL6               (CFS)   sched_yield
                         (RHEL5           knob

                    •         Java

                    • Linux upstream   knob
                        CPU



Sunday, July 17, 2011
•   fairness




Sunday, July 17, 2011
•          fairness

                    •                     GVL




         gvl_acquire                            gvl_release
         mutex_lock(&lock->lock)                mutex_lock(&lock->lock)
         cond_wait(&lock->wait)                 lock->acquired = 0;
         lock->acquired = 1;                    cond_signal(&lock->wait_cond)

         //                                     //
         cond_signal(&lock->switch_cond)        cond_wait(&lock->switch_cond)

         mutex_unlock(&lock->lock)              mutex_unlock(&lock->lock)
Sunday, July 17, 2011
vm_thread_pipe
  lmax = 100_000
  r, w = IO.pipe
  [Thread.new{
    lmax.times{
      w.write('a')
    }
    p "w:exit"
  }, Thread.new{
    lmax.times{
      r.read(1)
    }
    p "r:exit"
  }].each{|t| t.join}
Sunday, July 17, 2011
(´   ω   )

Sunday, July 17, 2011
• fairness

                    •         unfairness



                    • Linux


                    •

Sunday, July 17, 2011
1.9.3
                    • 1.9.3      IO   GVL release
                        GVL release

                    • IO                GVL     1.9.2       IO   GVL
                        switch

                    •
                                              GVL release    switch
                                          GVL

                    •

Sunday, July 17, 2011
1.9.2          1.9.3

              2


         1.5


              1


         0.5


              0
                  create_join mutex1   mutex2   mutex3 pass_flood   pipe


Sunday, July 17, 2011
•   1.9.2

                    •

                    •



                    •

Sunday, July 17, 2011
vm_thread_mutex3




Sunday, July 17, 2011
Sunday, July 17, 2011
•            CPU

           • GVL              CPU

           •                   Ruby




Sunday, July 17, 2011
Question?




Sunday, July 17, 2011

Weitere ähnliche Inhalte

Ähnlich wie Ruby gvl-improvement at ruby 1.9.3

Clouds against the Floods (RubyConfBR2011)
Clouds against the Floods (RubyConfBR2011) Clouds against the Floods (RubyConfBR2011)
Clouds against the Floods (RubyConfBR2011) Leonardo Borges
 
Puppet camp europe 2011 hackability
Puppet camp europe 2011   hackabilityPuppet camp europe 2011   hackability
Puppet camp europe 2011 hackabilityPuppet
 
JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011Charles Nutter
 
Writing a Crawler with Python and TDD
Writing a Crawler with Python and TDDWriting a Crawler with Python and TDD
Writing a Crawler with Python and TDDAndrea Francia
 
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)OpenBlend society
 
Conquistando el Servidor con Node.JS
Conquistando el Servidor con Node.JSConquistando el Servidor con Node.JS
Conquistando el Servidor con Node.JSCaridy Patino
 
Erlang: Bult for concurrent, distributed systems
Erlang: Bult for concurrent, distributed systemsErlang: Bult for concurrent, distributed systems
Erlang: Bult for concurrent, distributed systemsKen Pratt
 
让开发也懂前端
让开发也懂前端让开发也懂前端
让开发也懂前端lifesinger
 
Javascript Basics - part 1
Javascript Basics - part 1Javascript Basics - part 1
Javascript Basics - part 1Kasia Drzyzga
 
Google kick ass-game_programming_with_gwt
Google   kick ass-game_programming_with_gwtGoogle   kick ass-game_programming_with_gwt
Google kick ass-game_programming_with_gwtmomobeijing
 
international PHP2011_ilia alshanetsky_Hidden Features of PHP
international PHP2011_ilia alshanetsky_Hidden Features of PHPinternational PHP2011_ilia alshanetsky_Hidden Features of PHP
international PHP2011_ilia alshanetsky_Hidden Features of PHPsmueller_sandsmedia
 
잘 알려지지 않은 Php 코드 활용하기
잘 알려지지 않은 Php 코드 활용하기잘 알려지지 않은 Php 코드 활용하기
잘 알려지지 않은 Php 코드 활용하기형우 안
 
Javascript - How to avoid the bad parts
Javascript - How to avoid the bad partsJavascript - How to avoid the bad parts
Javascript - How to avoid the bad partsMikko Ohtamaa
 
Ruby hollywood
Ruby hollywoodRuby hollywood
Ruby hollywoodehuard
 
Image and Music: Processing plus Pure Data with libpd library
Image and Music: Processing plus Pure Data with libpd libraryImage and Music: Processing plus Pure Data with libpd library
Image and Music: Processing plus Pure Data with libpd libraryPETER KIRN
 

Ähnlich wie Ruby gvl-improvement at ruby 1.9.3 (20)

Clouds against the Floods (RubyConfBR2011)
Clouds against the Floods (RubyConfBR2011) Clouds against the Floods (RubyConfBR2011)
Clouds against the Floods (RubyConfBR2011)
 
Puppet camp europe 2011 hackability
Puppet camp europe 2011   hackabilityPuppet camp europe 2011   hackability
Puppet camp europe 2011 hackability
 
JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011
 
Writing a Crawler with Python and TDD
Writing a Crawler with Python and TDDWriting a Crawler with Python and TDD
Writing a Crawler with Python and TDD
 
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)
 
Caridy patino - node-js
Caridy patino - node-jsCaridy patino - node-js
Caridy patino - node-js
 
Conquistando el Servidor con Node.JS
Conquistando el Servidor con Node.JSConquistando el Servidor con Node.JS
Conquistando el Servidor con Node.JS
 
Erlang: Bult for concurrent, distributed systems
Erlang: Bult for concurrent, distributed systemsErlang: Bult for concurrent, distributed systems
Erlang: Bult for concurrent, distributed systems
 
让开发也懂前端
让开发也懂前端让开发也懂前端
让开发也懂前端
 
Geolinkeddata 07042011 1
Geolinkeddata 07042011 1Geolinkeddata 07042011 1
Geolinkeddata 07042011 1
 
GeoLinkedData
GeoLinkedDataGeoLinkedData
GeoLinkedData
 
Web Operations Career
Web Operations CareerWeb Operations Career
Web Operations Career
 
Javascript Basics - part 1
Javascript Basics - part 1Javascript Basics - part 1
Javascript Basics - part 1
 
Google kick ass-game_programming_with_gwt
Google   kick ass-game_programming_with_gwtGoogle   kick ass-game_programming_with_gwt
Google kick ass-game_programming_with_gwt
 
international PHP2011_ilia alshanetsky_Hidden Features of PHP
international PHP2011_ilia alshanetsky_Hidden Features of PHPinternational PHP2011_ilia alshanetsky_Hidden Features of PHP
international PHP2011_ilia alshanetsky_Hidden Features of PHP
 
잘 알려지지 않은 Php 코드 활용하기
잘 알려지지 않은 Php 코드 활용하기잘 알려지지 않은 Php 코드 활용하기
잘 알려지지 않은 Php 코드 활용하기
 
Javascript - How to avoid the bad parts
Javascript - How to avoid the bad partsJavascript - How to avoid the bad parts
Javascript - How to avoid the bad parts
 
Ruby hollywood
Ruby hollywoodRuby hollywood
Ruby hollywood
 
RunDeck
RunDeckRunDeck
RunDeck
 
Image and Music: Processing plus Pure Data with libpd library
Image and Music: Processing plus Pure Data with libpd libraryImage and Music: Processing plus Pure Data with libpd library
Image and Music: Processing plus Pure Data with libpd library
 

Kürzlich hochgeladen

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 

Kürzlich hochgeladen (20)

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 

Ruby gvl-improvement at ruby 1.9.3

  • 1. Ruby 1.9.3 GVL Fujitsu Sunday, July 17, 2011
  • 2. Who am I? Sunday, July 17, 2011
  • 3. • IO OS • usa Sunday, July 17, 2011
  • 4. at Linux Kernel Summit 2010 Sunday, July 17, 2011
  • 5. Shyouhei commiter ranking me! Sunday, July 17, 2011
  • 9. What’s GVL • Global(or Giant) VM Lock • • multi thread issue Ruby script • CPU • Python Sunday, July 17, 2011
  • 10. What’s GVL (cont.) • GVL • GVL • OS Sunday, July 17, 2011
  • 11. f = false Thread.new { ....; f = true } Thread.pass until f Sunday, July 17, 2011
  • 12. GVL design • Lock wait (e.g. write) • lock, unlock Python, QEMU, Linux • GVL acquire/release pthread_mutex_{lock,unlock} Sunday, July 17, 2011
  • 13. GVL design (cont.) • • Sunday, July 17, 2011
  • 14. GVL design (cont.) • ON if (th->interrupt_flag) { gvl_release(); sched_yield(); gvl_acquire(); } Sunday, July 17, 2011
  • 15. OSS while (true) { ( ) lock(); if (hoge) { unlock(); break; • } unlock(); • thread lock rep_nop(); } hoge=1 lock(); hoge = 1; unlock(); Sunday, July 17, 2011
  • 17. CPU cpu1 cpu2 memory core core core core memory 1 2 core core core core Sunday, July 17, 2011
  • 18. if (th->interrupt_flag) { gvl_release(); sched_yield(); gvl_acquire(); } •gvl_release() gvl_acquire() sched_yield() • sched_yield() yield Sunday, July 17, 2011
  • 19. sched_yield • Unix API http://pubs.opengroup.org/onlinepubs/009695399/ functions/sched_yield.html int sched_yield(void); • The sched_yield() function shall force the running thread to relinquish the processor until it again becomes the head of its thread list. • Sunday, July 17, 2011
  • 20. Thread core Thread Thread Thread Thread core Thread core Sunday, July 17, 2011
  • 21. (ry CPU Thread core Thread Thread Thread core Thread Thread core Thread Sunday, July 17, 2011
  • 22. Yield! Ruby Thread core Thread Thread core Ruby Thread Sunday, July 17, 2011
  • 23. thread list head Thread core Ruby Thread Thread core Ruby Thread Sunday, July 17, 2011
  • 24. Ruby Thread core Thread Thread core Ruby Thread POSIX Sunday, July 17, 2011
  • 25. CFS yield • Linux RHEL5 RHEL6 • RHEL6 (CFS) sched_yield (RHEL5 knob • Java • Linux upstream knob CPU Sunday, July 17, 2011
  • 26. fairness Sunday, July 17, 2011
  • 27. fairness • GVL gvl_acquire gvl_release mutex_lock(&lock->lock) mutex_lock(&lock->lock) cond_wait(&lock->wait) lock->acquired = 0; lock->acquired = 1; cond_signal(&lock->wait_cond) // // cond_signal(&lock->switch_cond) cond_wait(&lock->switch_cond) mutex_unlock(&lock->lock) mutex_unlock(&lock->lock) Sunday, July 17, 2011
  • 28. vm_thread_pipe lmax = 100_000 r, w = IO.pipe [Thread.new{ lmax.times{ w.write('a') } p "w:exit" }, Thread.new{ lmax.times{ r.read(1) } p "r:exit" }].each{|t| t.join} Sunday, July 17, 2011
  • 29. ω ) Sunday, July 17, 2011
  • 30. • fairness • unfairness • Linux • Sunday, July 17, 2011
  • 31. 1.9.3 • 1.9.3 IO GVL release GVL release • IO GVL 1.9.2 IO GVL switch • GVL release switch GVL • Sunday, July 17, 2011
  • 32. 1.9.2 1.9.3 2 1.5 1 0.5 0 create_join mutex1 mutex2 mutex3 pass_flood pipe Sunday, July 17, 2011
  • 33. 1.9.2 • • • Sunday, July 17, 2011
  • 36. CPU • GVL CPU • Ruby Sunday, July 17, 2011

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n