SlideShare uma empresa Scribd logo
1 de 57
Baixar para ler offline
Go, D, C++ and the
                           Multicore Revolution

                                         Russel Winder
                                       email: russel@winder.org.uk
                                      xmpp: russel@winder.org.uk
                                         twitter: russel_winder




Copyright © 2011–2012 Russel Winder                                  1
Aims, Goals and Objects
     ●   Show that shared memory multi-threading should
         return to being an operating systems development
         technique and not continue to be pushed as an
         applications programming technique.
     ●   Show, possibly, that the C++11 standard may,
         perhaps, have saved C++ from the dustbin of
         obscurity.




Copyright © 2011–2012 Russel Winder                         2
Structure


                                      A beginning.

                                       A middle.

                                        An end.

Copyright © 2011–2012 Russel Winder                  3
Protocol
     ●   Questions or short comments during the session are
         entirely in order.
     ●   Let me know you have an interjection by raising
         your hand, and when I come to an appropriate
         pause, I'll pass you the token.

                                      Questions, answers, comments, etc. appearing
                                      to get too long as interjections may get stacked
                                      to be unstacked at a break.


Copyright © 2011–2012 Russel Winder                                                      4
Interstitial Advertisement




Copyright © 2011–2012 Russel Winder                  5
A Beginning




Copyright © 2011–2012 Russel Winder                 6
It is no longer contentious that
                         The Multicore Revolution
                             is well underway.




Copyright © 2011–2012 Russel Winder                     7
Quad core laptops and phones.

                    Eight and twelve core workstations.

                         Servers with “zillions” of cores.




Copyright © 2011–2012 Russel Winder                          8
Software technology
                                  is now lagging
                               hardware technology
                                    by decades.



Copyright © 2011–2012 Russel Winder                  9
Operating systems manage cores
                            with kernel threads.

         Operating systems are fundamentally shared
              memory multi-threaded systems.

            Operating systems rightly use all the lock,
             semaphore, monitor, etc. technologies.



Copyright © 2011–2012 Russel Winder                       10
Operating systems really rather need
                      to be native code systems.




Copyright © 2011–2012 Russel Winder                      11
Constructive dichotomies…




Copyright © 2011–2012 Russel Winder               12
Native code languages.

                                               vs.

                      Virtual machine based languages.




Copyright © 2011–2012 Russel Winder                            13
Statically typed languages.

                                          vs.

                          Dynamically typed languages.




Copyright © 2011–2012 Russel Winder                         14
Compiled languages.

                                              vs.

                         Scripting languages languages.




Copyright © 2011–2012 Russel Winder                         15
Imperative languages.

                                               vs.

                                      Declarative languages.




Copyright © 2011–2012 Russel Winder                            16
Sequential.

                                          vs.

                                       Parallel.




Copyright © 2011–2012 Russel Winder                 17
Computationally intensive.

                                           vs.

                                      I/O intensive.




Copyright © 2011–2012 Russel Winder                        18
Batch flow.

                                           vs.

                                      Event driven.




Copyright © 2011–2012 Russel Winder                   19
Monolithic systems.

                                              vs.

                                 Cooperating subsystems.




Copyright © 2011–2012 Russel Winder                         20
Computationally intensive systems or
             subsystems definitely have to be parallel.

                  Other systems likely use concurrency
                          but not parallelism.




Copyright © 2011–2012 Russel Winder                       21
Concurrency is a design tool.


                         Parallelism is a tool to improve
                          computational performance.




Copyright © 2011–2012 Russel Winder                         22
Static vs. Dynamic
     ●   Fortran                               ●   Python, Jython
     ●   C                                     ●   Lisp, Clojure
     ●   C++                                   ●   Ruby, JRuby
     ●   D                                     ●   Groovy
     ●   Go
                                               ●   JavaScript
     ●   Rust
     ●   Java
                                               ●   Dart
     ●   Scala
     ●   Ceylon
     ●   Kotlin                                COBOL

Copyright © 2011–2012 Russel Winder                                 23
A Middle




Copyright © 2011–2012 Russel Winder              24
It's all about controlling
                      concurrency with tools that
                       programmers find usable.




Copyright © 2011–2012 Russel Winder                  25
Shared memory multi-threading is an
                operating system technique.




Copyright © 2011–2012 Russel Winder               26
Applications and tools programmers
               need computational models with
                  integrated synchronization.




Copyright © 2011–2012 Russel Winder                27
Dataflow
                                            Operators connected by
    Actors                                  channels with activity
    Independent processes                   triggered by arrival of
    communicating via                       data on the channels.
    asynchronous exchange
    of messages



                                      CSP
                                      Sequential processes
                                      connected by channels
                                      using synchronous message
                                      exchange (rendezvous).
Copyright © 2011–2012 Russel Winder                                   28
Actors
    Independent processes
    communicating via
    asynchronous exchange
    of messages




Copyright © 2011–2012 Russel Winder   29
Dataflow
                                      Operators connected by
                                      channels with activity
                                      triggered by arrival of
                                      data on the channels.




Copyright © 2011–2012 Russel Winder                             30
CSP
                                      Sequential processes
                                      connected by channels
                                      using synchronous message
                                      exchange (rendezvous).
Copyright © 2011–2012 Russel Winder                               31
Need examples.




Copyright © 2011–2012 Russel Winder                    32

Copyright © 2011–2012 Russel Winder       33
What is the Value of  ?
     ●
         Easy, it's known exactly, it's  (obviously).




                                       It's simples

                                                Александр Орлов   2009




Copyright © 2011–2012 Russel Winder                                      34
Approximating 
     ●   What is it's value represented as a floating point
         number?
          ●   We can only obtain an approximation.
          ●   A plethora of possible algorithms to choose from, a
              popular one is to employ the following integral
              equation.


                                                  1  1
                                                 =∫0       dx
                                               4     1x 2




Copyright © 2011–2012 Russel Winder                                 35
One Possible Algorithm
     ●   Use quadrature to estimate the value of the integral
         – which is the area under the curve.
                                        4 n          1
                                      = ∑i=1
                                        n           i−0.5 2
   Embarrassingly parallel.                     1      
                                                       n


                                                     With n = 3 not much to do,
                                                     but potentially lots of error.
                                                     Use n = 107 or n = 109?



Copyright © 2011–2012 Russel Winder                                                   36
Scatter – Gather




                                      map         reduce
Copyright © 2011–2012 Russel Winder                        37
Code!



Copyright © 2011–2012 Russel Winder           38
Need another example.




Copyright © 2011–2012 Russel Winder                 39
The Sleeping Barber Problem




Copyright © 2011–2012 Russel Winder        40
The Sleeping Barber Problem
     ●   The barber's shop has a          ●   If the barber is cutting, a new
         single cutting chair and a row       customer checks to see if
         of waiting seats.                    there is a free waiting seat.
     ●   The barber sleeps in the             ●   If there is join the queue
         cutting chair unless trimming            to be trimmed.
         a customer.                          ●   If there isn't leave
     ●   Customers arrive at the shop             disgruntled.
         at intervals.
     ●   If the barber is asleep, the
         customer wakes the barber                 Problem originally due
         takes the cutting chair and               to Edsgar Dijkstra.
         gets a trim.
Copyright © 2011–2012 Russel Winder                                             41
The cutting chair.

      The waiting chairs




                                          The barber's shop.

  A new customer enters the shop,
  check to see if they can go straight
  to the cutting chair, if not can they
  take a waiting chair, if not leave.

Copyright © 2011–2012 Russel Winder                                 42
Wikipedia article presents the classic operating
      systems approach using locks and semaphores.

           http://en.wikipedia.org/wiki/Sleeping_barber_problem




Copyright © 2011–2012 Russel Winder                               43
More code!



Copyright © 2011–2012 Russel Winder                44
Note to Self:

                                      Did you, in fact, show all
                                      the examples in:
                                         ●   C
                                         ●   D
                                         ●   Go
                                         ●   C++
                                         ●   Python

Copyright © 2011–2012 Russel Winder                                45
An End




Copyright © 2011–2012 Russel Winder            46
Native code language are just as
                    much scripting languages as
                     virtual machine languages
                        and interpreted ones.




Copyright © 2011–2012 Russel Winder                   47
Virtual machine languages are
                         just as fast as native code
                        languages when using JITs.




Copyright © 2011–2012 Russel Winder                    48
Multicore and multiprocessor
                            are now the norm,
                            not the exception.




Copyright © 2011–2012 Russel Winder                   49
Parallelism only matters
                                 if computational
                               performance matters.




Copyright © 2011–2012 Russel Winder                      50
Unstructured synchronization
                           of concurrent systems
                        is not a feasible approach.




Copyright © 2011–2012 Russel Winder                   51
Actors, CSP and Dataflow
                                 are the future of
                              applications structure.




Copyright © 2011–2012 Russel Winder                     52
Passing messages between
                        processes is the way forward.




Copyright © 2011–2012 Russel Winder                     53
Shared memory concurrency
                      is a dead end for applications.




Copyright © 2011–2012 Russel Winder                     54
Surreptitious Advertisement




Copyright © 2011–2012 Russel Winder                55
The End




Copyright © 2011–2012 Russel Winder             56
Go, D, C++ and the
                           Multicore Revolution

                                         Russel Winder
                                       email: russel@winder.org.uk
                                      xmpp: russel@winder.org.uk
                                         twitter: russel_winder




Copyright © 2011–2012 Russel Winder                                  57

Mais conteúdo relacionado

Semelhante a ACCU 2012: Go, D, C++ and The Multicore Revolution

Just Keep Sending The Messages
Just Keep Sending The MessagesJust Keep Sending The Messages
Just Keep Sending The MessagesRussel Winder
 
Just Keep Sending The Messages
Just Keep Sending The MessagesJust Keep Sending The Messages
Just Keep Sending The MessagesRussel Winder
 
Just Keep Passing the Messages from Groovy and Grails eXchange 2011
Just Keep Passing the Messages from Groovy and Grails eXchange 2011Just Keep Passing the Messages from Groovy and Grails eXchange 2011
Just Keep Passing the Messages from Groovy and Grails eXchange 2011Russel Winder
 
Closures, the next "Big Thing" in Java: Russel Winder
Closures, the next "Big Thing" in Java: Russel WinderClosures, the next "Big Thing" in Java: Russel Winder
Closures, the next "Big Thing" in Java: Russel WinderJAX London
 
Closures: The Next "Big Thing" In Java
Closures: The Next "Big Thing" In JavaClosures: The Next "Big Thing" In Java
Closures: The Next "Big Thing" In JavaRussel Winder
 
On Concurrency and Parallelism in the JVMverse
On Concurrency and Parallelism in the JVMverseOn Concurrency and Parallelism in the JVMverse
On Concurrency and Parallelism in the JVMverseRussel Winder
 
Dataflow: the concurrency/parallelism architecture you need
Dataflow: the concurrency/parallelism architecture you needDataflow: the concurrency/parallelism architecture you need
Dataflow: the concurrency/parallelism architecture you needRussel Winder
 
Structured development in BMC Remedy AR System
Structured development in BMC Remedy AR SystemStructured development in BMC Remedy AR System
Structured development in BMC Remedy AR Systemgramlin42
 
Cloud Disaster Recovery
Cloud Disaster Recovery Cloud Disaster Recovery
Cloud Disaster Recovery OpSource
 
Mobile trends and impressions
Mobile trends and impressionsMobile trends and impressions
Mobile trends and impressionsShafaq Abdullah
 
Introduction to OMG DDS (1 hour, 45 slides)
Introduction to OMG DDS (1 hour, 45 slides)Introduction to OMG DDS (1 hour, 45 slides)
Introduction to OMG DDS (1 hour, 45 slides)Gerardo Pardo-Castellote
 
Behind the curtain secrets to mobile app wizardry - paul gelb razrofish sxsw
Behind the curtain   secrets to mobile app wizardry - paul gelb razrofish sxswBehind the curtain   secrets to mobile app wizardry - paul gelb razrofish sxsw
Behind the curtain secrets to mobile app wizardry - paul gelb razrofish sxswPaul Gelb
 
Fluxx-The Tested User event-011112-main presentation
Fluxx-The Tested User event-011112-main presentationFluxx-The Tested User event-011112-main presentation
Fluxx-The Tested User event-011112-main presentationFluxx
 
Building Agile Data Warehouses with Ralph Hughes
Building Agile Data Warehouses with Ralph HughesBuilding Agile Data Warehouses with Ralph Hughes
Building Agile Data Warehouses with Ralph HughesKalido
 
Responsive Web Design in Oracle Application Express
Responsive Web Design in Oracle Application ExpressResponsive Web Design in Oracle Application Express
Responsive Web Design in Oracle Application ExpressShakeeb Rahman
 
eFolder Webinar: How One Partner Leverages Dell AppAssure and StorageCraft
eFolder Webinar: How One Partner Leverages Dell AppAssure and StorageCrafteFolder Webinar: How One Partner Leverages Dell AppAssure and StorageCraft
eFolder Webinar: How One Partner Leverages Dell AppAssure and StorageCraftDropbox
 
Design Frameworks for Analysis and Synthesis of Complex Systems
Design Frameworks for Analysis and Synthesis of Complex SystemsDesign Frameworks for Analysis and Synthesis of Complex Systems
Design Frameworks for Analysis and Synthesis of Complex Systemsdrjanroodt
 

Semelhante a ACCU 2012: Go, D, C++ and The Multicore Revolution (20)

Just Keep Sending The Messages
Just Keep Sending The MessagesJust Keep Sending The Messages
Just Keep Sending The Messages
 
Just Keep Sending The Messages
Just Keep Sending The MessagesJust Keep Sending The Messages
Just Keep Sending The Messages
 
Just Keep Passing the Messages from Groovy and Grails eXchange 2011
Just Keep Passing the Messages from Groovy and Grails eXchange 2011Just Keep Passing the Messages from Groovy and Grails eXchange 2011
Just Keep Passing the Messages from Groovy and Grails eXchange 2011
 
GPars Workshop
GPars WorkshopGPars Workshop
GPars Workshop
 
Closures, the next "Big Thing" in Java: Russel Winder
Closures, the next "Big Thing" in Java: Russel WinderClosures, the next "Big Thing" in Java: Russel Winder
Closures, the next "Big Thing" in Java: Russel Winder
 
Closures: The Next "Big Thing" In Java
Closures: The Next "Big Thing" In JavaClosures: The Next "Big Thing" In Java
Closures: The Next "Big Thing" In Java
 
On Concurrency and Parallelism in the JVMverse
On Concurrency and Parallelism in the JVMverseOn Concurrency and Parallelism in the JVMverse
On Concurrency and Parallelism in the JVMverse
 
Dataflow: the concurrency/parallelism architecture you need
Dataflow: the concurrency/parallelism architecture you needDataflow: the concurrency/parallelism architecture you need
Dataflow: the concurrency/parallelism architecture you need
 
Structured development in BMC Remedy AR System
Structured development in BMC Remedy AR SystemStructured development in BMC Remedy AR System
Structured development in BMC Remedy AR System
 
Cloud Disaster Recovery
Cloud Disaster Recovery Cloud Disaster Recovery
Cloud Disaster Recovery
 
Mobile trends and impressions
Mobile trends and impressionsMobile trends and impressions
Mobile trends and impressions
 
Introduction to OMG DDS (1 hour, 45 slides)
Introduction to OMG DDS (1 hour, 45 slides)Introduction to OMG DDS (1 hour, 45 slides)
Introduction to OMG DDS (1 hour, 45 slides)
 
The Promise of Interoperability
The Promise of InteroperabilityThe Promise of Interoperability
The Promise of Interoperability
 
Behind the curtain secrets to mobile app wizardry - paul gelb razrofish sxsw
Behind the curtain   secrets to mobile app wizardry - paul gelb razrofish sxswBehind the curtain   secrets to mobile app wizardry - paul gelb razrofish sxsw
Behind the curtain secrets to mobile app wizardry - paul gelb razrofish sxsw
 
Fluxx-The Tested User event-011112-main presentation
Fluxx-The Tested User event-011112-main presentationFluxx-The Tested User event-011112-main presentation
Fluxx-The Tested User event-011112-main presentation
 
Building Agile Data Warehouses with Ralph Hughes
Building Agile Data Warehouses with Ralph HughesBuilding Agile Data Warehouses with Ralph Hughes
Building Agile Data Warehouses with Ralph Hughes
 
Responsive Web Design in Oracle Application Express
Responsive Web Design in Oracle Application ExpressResponsive Web Design in Oracle Application Express
Responsive Web Design in Oracle Application Express
 
eFolder Webinar: How One Partner Leverages Dell AppAssure and StorageCraft
eFolder Webinar: How One Partner Leverages Dell AppAssure and StorageCrafteFolder Webinar: How One Partner Leverages Dell AppAssure and StorageCraft
eFolder Webinar: How One Partner Leverages Dell AppAssure and StorageCraft
 
Business Models for Interoperability
Business Models for InteroperabilityBusiness Models for Interoperability
Business Models for Interoperability
 
Design Frameworks for Analysis and Synthesis of Complex Systems
Design Frameworks for Analysis and Synthesis of Complex SystemsDesign Frameworks for Analysis and Synthesis of Complex Systems
Design Frameworks for Analysis and Synthesis of Complex Systems
 

Mais de Russel Winder

The Case for Kotlin and Ceylon
The Case for Kotlin and CeylonThe Case for Kotlin and Ceylon
The Case for Kotlin and CeylonRussel Winder
 
On the Architectures of Microservices: the next layer
On the Architectures of Microservices: the next layerOn the Architectures of Microservices: the next layer
On the Architectures of Microservices: the next layerRussel Winder
 
Fast Python? Don't Bother
Fast Python? Don't BotherFast Python? Don't Bother
Fast Python? Don't BotherRussel Winder
 
Making Python computations fast
Making Python computations fastMaking Python computations fast
Making Python computations fastRussel Winder
 
Tales from the Workshops
Tales from the WorkshopsTales from the Workshops
Tales from the WorkshopsRussel Winder
 
Making Computations Execute Very Quickly
Making Computations Execute Very QuicklyMaking Computations Execute Very Quickly
Making Computations Execute Very QuicklyRussel Winder
 
Java is Dead, Long Live Ceylon, Kotlin, etc
Java is Dead,  Long Live Ceylon, Kotlin, etcJava is Dead,  Long Live Ceylon, Kotlin, etc
Java is Dead, Long Live Ceylon, Kotlin, etcRussel Winder
 
Java is dead, long live Scala, Kotlin, Ceylon, etc.
Java is dead, long live Scala, Kotlin, Ceylon, etc.Java is dead, long live Scala, Kotlin, Ceylon, etc.
Java is dead, long live Scala, Kotlin, Ceylon, etc.Russel Winder
 
Spocktacular testing
Spocktacular testingSpocktacular testing
Spocktacular testingRussel Winder
 
Spocktacular Testing
Spocktacular TestingSpocktacular Testing
Spocktacular TestingRussel Winder
 
Is Groovy static or dynamic
Is Groovy static or dynamicIs Groovy static or dynamic
Is Groovy static or dynamicRussel Winder
 
Java is dead, long live Scala Kotlin Ceylon etc.
Java is dead, long live Scala Kotlin Ceylon etc.Java is dead, long live Scala Kotlin Ceylon etc.
Java is dead, long live Scala Kotlin Ceylon etc.Russel Winder
 
Are Go and D threats to Python
Are Go and D threats to PythonAre Go and D threats to Python
Are Go and D threats to PythonRussel Winder
 
Is Groovy as fast as Java
Is Groovy as fast as JavaIs Groovy as fast as Java
Is Groovy as fast as JavaRussel Winder
 
Who needs C++ when you have D and Go
Who needs C++ when you have D and GoWho needs C++ when you have D and Go
Who needs C++ when you have D and GoRussel Winder
 
Java 8: a New Beginning
Java 8: a New BeginningJava 8: a New Beginning
Java 8: a New BeginningRussel Winder
 
Why Go is an important programming language
Why Go is an important programming languageWhy Go is an important programming language
Why Go is an important programming languageRussel Winder
 
GPars: Groovy Parallelism for Java
GPars: Groovy Parallelism for JavaGPars: Groovy Parallelism for Java
GPars: Groovy Parallelism for JavaRussel Winder
 

Mais de Russel Winder (20)

The Case for Kotlin and Ceylon
The Case for Kotlin and CeylonThe Case for Kotlin and Ceylon
The Case for Kotlin and Ceylon
 
On the Architectures of Microservices: the next layer
On the Architectures of Microservices: the next layerOn the Architectures of Microservices: the next layer
On the Architectures of Microservices: the next layer
 
Fast Python? Don't Bother
Fast Python? Don't BotherFast Python? Don't Bother
Fast Python? Don't Bother
 
Making Python computations fast
Making Python computations fastMaking Python computations fast
Making Python computations fast
 
Tales from the Workshops
Tales from the WorkshopsTales from the Workshops
Tales from the Workshops
 
Making Computations Execute Very Quickly
Making Computations Execute Very QuicklyMaking Computations Execute Very Quickly
Making Computations Execute Very Quickly
 
Java is Dead, Long Live Ceylon, Kotlin, etc
Java is Dead,  Long Live Ceylon, Kotlin, etcJava is Dead,  Long Live Ceylon, Kotlin, etc
Java is Dead, Long Live Ceylon, Kotlin, etc
 
GPars Remoting
GPars RemotingGPars Remoting
GPars Remoting
 
Java is dead, long live Scala, Kotlin, Ceylon, etc.
Java is dead, long live Scala, Kotlin, Ceylon, etc.Java is dead, long live Scala, Kotlin, Ceylon, etc.
Java is dead, long live Scala, Kotlin, Ceylon, etc.
 
GPars 2014
GPars 2014GPars 2014
GPars 2014
 
Spocktacular testing
Spocktacular testingSpocktacular testing
Spocktacular testing
 
Spocktacular Testing
Spocktacular TestingSpocktacular Testing
Spocktacular Testing
 
Is Groovy static or dynamic
Is Groovy static or dynamicIs Groovy static or dynamic
Is Groovy static or dynamic
 
Java is dead, long live Scala Kotlin Ceylon etc.
Java is dead, long live Scala Kotlin Ceylon etc.Java is dead, long live Scala Kotlin Ceylon etc.
Java is dead, long live Scala Kotlin Ceylon etc.
 
Are Go and D threats to Python
Are Go and D threats to PythonAre Go and D threats to Python
Are Go and D threats to Python
 
Is Groovy as fast as Java
Is Groovy as fast as JavaIs Groovy as fast as Java
Is Groovy as fast as Java
 
Who needs C++ when you have D and Go
Who needs C++ when you have D and GoWho needs C++ when you have D and Go
Who needs C++ when you have D and Go
 
Java 8: a New Beginning
Java 8: a New BeginningJava 8: a New Beginning
Java 8: a New Beginning
 
Why Go is an important programming language
Why Go is an important programming languageWhy Go is an important programming language
Why Go is an important programming language
 
GPars: Groovy Parallelism for Java
GPars: Groovy Parallelism for JavaGPars: Groovy Parallelism for Java
GPars: Groovy Parallelism for Java
 

Último

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Último (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

ACCU 2012: Go, D, C++ and The Multicore Revolution

  • 1. Go, D, C++ and the Multicore Revolution Russel Winder email: russel@winder.org.uk xmpp: russel@winder.org.uk twitter: russel_winder Copyright © 2011–2012 Russel Winder 1
  • 2. Aims, Goals and Objects ● Show that shared memory multi-threading should return to being an operating systems development technique and not continue to be pushed as an applications programming technique. ● Show, possibly, that the C++11 standard may, perhaps, have saved C++ from the dustbin of obscurity. Copyright © 2011–2012 Russel Winder 2
  • 3. Structure A beginning. A middle. An end. Copyright © 2011–2012 Russel Winder 3
  • 4. Protocol ● Questions or short comments during the session are entirely in order. ● Let me know you have an interjection by raising your hand, and when I come to an appropriate pause, I'll pass you the token. Questions, answers, comments, etc. appearing to get too long as interjections may get stacked to be unstacked at a break. Copyright © 2011–2012 Russel Winder 4
  • 5. Interstitial Advertisement Copyright © 2011–2012 Russel Winder 5
  • 6. A Beginning Copyright © 2011–2012 Russel Winder 6
  • 7. It is no longer contentious that The Multicore Revolution is well underway. Copyright © 2011–2012 Russel Winder 7
  • 8. Quad core laptops and phones. Eight and twelve core workstations. Servers with “zillions” of cores. Copyright © 2011–2012 Russel Winder 8
  • 9. Software technology is now lagging hardware technology by decades. Copyright © 2011–2012 Russel Winder 9
  • 10. Operating systems manage cores with kernel threads. Operating systems are fundamentally shared memory multi-threaded systems. Operating systems rightly use all the lock, semaphore, monitor, etc. technologies. Copyright © 2011–2012 Russel Winder 10
  • 11. Operating systems really rather need to be native code systems. Copyright © 2011–2012 Russel Winder 11
  • 12. Constructive dichotomies… Copyright © 2011–2012 Russel Winder 12
  • 13. Native code languages. vs. Virtual machine based languages. Copyright © 2011–2012 Russel Winder 13
  • 14. Statically typed languages. vs. Dynamically typed languages. Copyright © 2011–2012 Russel Winder 14
  • 15. Compiled languages. vs. Scripting languages languages. Copyright © 2011–2012 Russel Winder 15
  • 16. Imperative languages. vs. Declarative languages. Copyright © 2011–2012 Russel Winder 16
  • 17. Sequential. vs. Parallel. Copyright © 2011–2012 Russel Winder 17
  • 18. Computationally intensive. vs. I/O intensive. Copyright © 2011–2012 Russel Winder 18
  • 19. Batch flow. vs. Event driven. Copyright © 2011–2012 Russel Winder 19
  • 20. Monolithic systems. vs. Cooperating subsystems. Copyright © 2011–2012 Russel Winder 20
  • 21. Computationally intensive systems or subsystems definitely have to be parallel. Other systems likely use concurrency but not parallelism. Copyright © 2011–2012 Russel Winder 21
  • 22. Concurrency is a design tool. Parallelism is a tool to improve computational performance. Copyright © 2011–2012 Russel Winder 22
  • 23. Static vs. Dynamic ● Fortran ● Python, Jython ● C ● Lisp, Clojure ● C++ ● Ruby, JRuby ● D ● Groovy ● Go ● JavaScript ● Rust ● Java ● Dart ● Scala ● Ceylon ● Kotlin COBOL Copyright © 2011–2012 Russel Winder 23
  • 24. A Middle Copyright © 2011–2012 Russel Winder 24
  • 25. It's all about controlling concurrency with tools that programmers find usable. Copyright © 2011–2012 Russel Winder 25
  • 26. Shared memory multi-threading is an operating system technique. Copyright © 2011–2012 Russel Winder 26
  • 27. Applications and tools programmers need computational models with integrated synchronization. Copyright © 2011–2012 Russel Winder 27
  • 28. Dataflow Operators connected by Actors channels with activity Independent processes triggered by arrival of communicating via data on the channels. asynchronous exchange of messages CSP Sequential processes connected by channels using synchronous message exchange (rendezvous). Copyright © 2011–2012 Russel Winder 28
  • 29. Actors Independent processes communicating via asynchronous exchange of messages Copyright © 2011–2012 Russel Winder 29
  • 30. Dataflow Operators connected by channels with activity triggered by arrival of data on the channels. Copyright © 2011–2012 Russel Winder 30
  • 31. CSP Sequential processes connected by channels using synchronous message exchange (rendezvous). Copyright © 2011–2012 Russel Winder 31
  • 32. Need examples. Copyright © 2011–2012 Russel Winder 32
  • 33.  Copyright © 2011–2012 Russel Winder 33
  • 34. What is the Value of  ? ● Easy, it's known exactly, it's  (obviously). It's simples Александр Орлов 2009 Copyright © 2011–2012 Russel Winder 34
  • 35. Approximating  ● What is it's value represented as a floating point number? ● We can only obtain an approximation. ● A plethora of possible algorithms to choose from, a popular one is to employ the following integral equation.  1 1 =∫0 dx 4 1x 2 Copyright © 2011–2012 Russel Winder 35
  • 36. One Possible Algorithm ● Use quadrature to estimate the value of the integral – which is the area under the curve. 4 n 1 = ∑i=1 n i−0.5 2 Embarrassingly parallel. 1  n With n = 3 not much to do, but potentially lots of error. Use n = 107 or n = 109? Copyright © 2011–2012 Russel Winder 36
  • 37. Scatter – Gather map reduce Copyright © 2011–2012 Russel Winder 37
  • 38. Code! Copyright © 2011–2012 Russel Winder 38
  • 39. Need another example. Copyright © 2011–2012 Russel Winder 39
  • 40. The Sleeping Barber Problem Copyright © 2011–2012 Russel Winder 40
  • 41. The Sleeping Barber Problem ● The barber's shop has a ● If the barber is cutting, a new single cutting chair and a row customer checks to see if of waiting seats. there is a free waiting seat. ● The barber sleeps in the ● If there is join the queue cutting chair unless trimming to be trimmed. a customer. ● If there isn't leave ● Customers arrive at the shop disgruntled. at intervals. ● If the barber is asleep, the customer wakes the barber Problem originally due takes the cutting chair and to Edsgar Dijkstra. gets a trim. Copyright © 2011–2012 Russel Winder 41
  • 42. The cutting chair. The waiting chairs The barber's shop. A new customer enters the shop, check to see if they can go straight to the cutting chair, if not can they take a waiting chair, if not leave. Copyright © 2011–2012 Russel Winder 42
  • 43. Wikipedia article presents the classic operating systems approach using locks and semaphores. http://en.wikipedia.org/wiki/Sleeping_barber_problem Copyright © 2011–2012 Russel Winder 43
  • 44. More code! Copyright © 2011–2012 Russel Winder 44
  • 45. Note to Self: Did you, in fact, show all the examples in: ● C ● D ● Go ● C++ ● Python Copyright © 2011–2012 Russel Winder 45
  • 46. An End Copyright © 2011–2012 Russel Winder 46
  • 47. Native code language are just as much scripting languages as virtual machine languages and interpreted ones. Copyright © 2011–2012 Russel Winder 47
  • 48. Virtual machine languages are just as fast as native code languages when using JITs. Copyright © 2011–2012 Russel Winder 48
  • 49. Multicore and multiprocessor are now the norm, not the exception. Copyright © 2011–2012 Russel Winder 49
  • 50. Parallelism only matters if computational performance matters. Copyright © 2011–2012 Russel Winder 50
  • 51. Unstructured synchronization of concurrent systems is not a feasible approach. Copyright © 2011–2012 Russel Winder 51
  • 52. Actors, CSP and Dataflow are the future of applications structure. Copyright © 2011–2012 Russel Winder 52
  • 53. Passing messages between processes is the way forward. Copyright © 2011–2012 Russel Winder 53
  • 54. Shared memory concurrency is a dead end for applications. Copyright © 2011–2012 Russel Winder 54
  • 55. Surreptitious Advertisement Copyright © 2011–2012 Russel Winder 55
  • 56. The End Copyright © 2011–2012 Russel Winder 56
  • 57. Go, D, C++ and the Multicore Revolution Russel Winder email: russel@winder.org.uk xmpp: russel@winder.org.uk twitter: russel_winder Copyright © 2011–2012 Russel Winder 57