FOSDEM 2011 - 0MQ

39,605 views
39,514 views

Published on

Slides for #FOSDEM 2011 talk on ØMQ by Pieter Hintjens

1 Comment
33 Likes
Statistics
Notes
  • Video of the talk (10 minutes) is here: http://www.youtube.com/watch?v=CCBYzKfmQ4U
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
39,605
On SlideShare
0
From Embeds
0
Number of Embeds
77
Actions
Shares
0
Downloads
445
Comments
1
Likes
33
Embeds 0
No embeds

No notes for slide

FOSDEM 2011 - 0MQ

  1. 1. Multithreading Magic Why Everything You Thought You Knew about Concurrency is Bogus, if not actually Totally Insane by Pieter Hintjens, CEO, iMatix FOSDEM 2011
  2. 2. Hintjens' Law of Concurrency e = mc 2 <ul><li>e is for effort , the pain that it takes
  3. 3. m is for mass , the size of the code
  4. 4. c is for conflict , when c threads collide </li></ul>
  5. 5. The Cost of Concurrency Where we end up Where we start
  6. 6. The Data-Centric Model Thread Thread Thread Thread <ul><li>The industry standard model for concurrency, based on the Big Iron computing model </li></ul>
  7. 7. What You (Probably) Know <ul><li>Concurrency = data shared between threads
  8. 8. So, locks, semaphores, critical sections
  9. 9. So, code that fails by default
  10. 10. So, complexity, weird bugs, race conditions
  11. 11. Diminishing returns as c exceeds ' a few '
  12. 12. A bogus, if not totally insane model </li></ul>
  13. 13. The Ideal World Where we end up Where we start
  14. 14. What You (Probably) Don't Know <ul><li>The Actor Model </li><ul><li>Carl Hewitt, 1973, &quot; Motivated by the prospect of thousands of independent microprocessors, each with its own local memory, communicating via a high-performance network .” – Wikipedia
  15. 15. Gives us concurrency with c = 1 </li></ul><li>For 30 years, mostly ignored </li><ul><li>Distributed systems were too small and rare
  16. 16. Maybe best known via Erlang </li></ul></ul>
  17. 17. Boxes, sending messages <ul><li>A better match for a world filled with CPUs </li></ul>Box Messages
  18. 18. Ingredients <ul><li>Lots of cheap boxes – check! </li><ul><li>Thousands of threads, processes, cores, systems </li></ul><li>Messages as contractual APIs – check! </li><ul><li>XML, YAML, JSON, etc.
  19. 19. Any level of meta we want </li></ul><li>A high-performance network? </li><ul><li>Brings us to ZeroMQ
  20. 20. Cheap and fast networking – check! </li></ul></ul>
  21. 21. ZeroMQ: e = mc 2 , for c = 1 <ul><li>Zero shared data – a modern Actor model
  22. 22. Connect threads, processes, boxes </li><ul><li>The same socket-style API for any transport </li></ul><li>Add any message contracts you want </li><ul><li>ZeroMQ transports blobs </li></ul><li>Connect tasks using messaging patterns </li><ul><li>Request-reply, pub-sub, pipeline,... </li></ul></ul>
  23. 23. Your ZeroMQ Applications <ul><li>Any mix of languages and platforms
  24. 24. No locks, semaphores, critical sections </li><ul><li>Each task has its state
  25. 25. Process incoming messages from all sources
  26. 26. Send onward messages to other tasks </li></ul><li>Scale to any number of cores </li><ul><li>Threads or processes on one box
  27. 27. Multiple boxes on one network </li></ul></ul>
  28. 28. Get ZeroMQ <ul><li>http://www.zeromq.org
  29. 29. Free software, LGPL licensed
  30. 30. In continuous development since 2007
  31. 31. Large, active community (~70 people on IRC)
  32. 32. APIs in C, C++, Python, Ruby, Perl, Java, Go, Erland, C#, PHP, Lua, Clisp, Haskell,...
  33. 33. Linux, UNIX, OS/X, Windows,... </li></ul>
  34. 34. About iMatix <ul><li>Messaging, free software, communities
  35. 35. In 2010 we turned ZeroMQ fully over to its community (which we are part of :-)
  36. 36. Our business is commercial support for companies using ZeroMQ in infrastructure projects
  37. 37. Contact me at [email_address] </li></ul>

×