Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Hybrid concurrency patterns

47.204 visualizaciones

Publicado el

Ruby developers need to stop using EventMachine. It's the wrong direction.

Lost in the "Threads vs Event Driven vs Process Spawning" debate is that you can combine them! Learn how Celluloid is improving thread programming by abstracting them using a higher level framework called Celluloid, how you can use Celluloid::IO to throw a reactor pattern into a thread. Using this approach, you can take advantage of threading and use all CPU power on a machine with JRuby or Rubinius. I also discuss the future of distributed objects and computing, and where I think things are going.

Publicado en: Entretenimiento y humor
  • DOWNLOAD FULL BOOKS, INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... ,DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ,DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ,DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ,DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ,DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ,DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Responder 
    ¿Estás seguro?    No
    Tu mensaje aparecerá aquí
  • DOWNLOAD FULL BOOKS, INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... ,DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ,DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ,DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ,DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ,DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ,DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Responder 
    ¿Estás seguro?    No
    Tu mensaje aparecerá aquí
  • DOWNLOAD FULL BOOKS, INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Responder 
    ¿Estás seguro?    No
    Tu mensaje aparecerá aquí
  • DOWNLOAD FULL BOOKS, INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Responder 
    ¿Estás seguro?    No
    Tu mensaje aparecerá aquí
  • Hey guys! Who wants to chat with me? More photos with me here 👉 http://www.bit.ly/katekoxx
       Responder 
    ¿Estás seguro?    No
    Tu mensaje aparecerá aquí

Hybrid concurrency patterns

  1. 1. Threads and Events inHarmony with Celluloid Kyle Drake
  2. 2. Hi, I’m Kyle Drake. Iwork at Geoloqi Esri.We built a geofencing Textand real-time location streaming platform.
  3. 3. Last year, IText a didtalk at KRTConf.
  4. 4. I was really intopure event-driven Text(reactor patternbased) architecture.
  5. 5. EventMachine, Twisted, Node.js• Event-driven Text• No threads• One CPU core• Process Spawning
  6. 6. I releasedsinatra-synchrony,so I could use TextEventMachinewithout callbacks.
  7. 7. Since then, I’ve Textchanged my mind.
  8. 8. I’m really not a fanof EventMachine Textanymore.
  9. 9. EventMachine is• A frankenstein - guts the ruby internals• Not in active development Text• Makes non-blocking IO block• Requires special code from Ruby libraries• Hard to use in an OOP way• Is really difficult to work with• Poorly documented
  10. 10. Ruby developersneed to stop usingEventMachine. It’s Textthe wrongdirection.
  11. 11. Check thisbenchmark Textout:
  12. 12. Texthttp://rhaas.blogspot.com/2012/04/did-i-say-32-cores-how-about-64.html
  13. 13. Predictions:More Cores.A lot more.
  14. 14. Predictions:More libraries =more memory
  15. 15. Will processspawning work forever? It might.
  16. 16. It might not.Thousands of cores?
  17. 17. Ruby MRI:Global Interpreter Lock (single CPU core) Rubinius and JRuby: Full threading (multiple CPU cores)~20KB per thread
  18. 18. We’re not finding a lot of thread safety issues in Ruby.
  19. 19. “Threading is hard”
  20. 20. Threading is not an intention!
  21. 21. Let’s fix it by abstractingthreads into how humans think!
  22. 22. http://celluloid.io• Developed by Tony Arcieri• Actor Pattern for Ruby• Lots of inspiration from Erlang
  23. 23. Each actor is aconcurrent objectrunning in its own thread
  24. 24. First “Killer App”: Sidekiq Mike Perham
  25. 25. Don’t get mewrong. Event-driven is still awesome.
  26. 26. “..seasoned engineers areusing a mix of threaded,event-based, andalternative concurrencyapproaches like Actors” - Alex Payne
  27. 27. What if we couldcombine threads and reactor patterns.. and actors?!
  28. 28. https://github.com/celluloid/celluloid-io• One reactor pattern per Celluloid object• Multiple reactors? No problem!• Doesn’t mess with code outside of actor• Utilizes all CPU cores (using JRuby and Rubinius)• Websockets, messaging systems, your hugelysuccessful blog
  29. 29. You dont have tochoose between threaded and evented IO!
  30. 30. Let’s getdistributed.
  31. 31. "I thought of objects being like biological cells and/or individual computers on a network, only able to communicate with messages" - Alan Kay
  32. 32. Guess who was really into distributed network objects?
  33. 33. NeXT experimented with distributedobjects in the mid 90s.NeXT was way ahead of its time.
  34. 34. "Objects can message objects transparentlythat live on other machines over the network, and you dont have to worry about thenetworking gunk, and you dont have to worry about finding them, and you dont have to worry about anything. Its just as if you messaged an object thats right next door." - Steve Jobs
  35. 35. “Portable Distributed Objects”
  36. 36. https://github.com/celluloid/dcell • Objects talk over networks! • Uses 0MQ • Aware of eachothers’ existence • Distributed gossip protocol • Web UI • In the early stages, very promising
  37. 37. CODEEXAMPLES!
  38. 38. Help UsBuild This!
  39. 39. Thanks! @kyledrakekyledrake.net

×