Skip to content

Instantly share code, notes, and snippets.

@907th
Forked from somebody32/gist:5232120
Last active December 15, 2015 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 907th/5260971 to your computer and use it in GitHub Desktop.
Save 907th/5260971 to your computer and use it in GitHub Desktop.
Multithreading reading list for Rubyists

Введение

Начать стоит отсюда. Не пугайтесь то, что это книга по незнакомой OS, эти термины практически везде одинаковые и здесь они изложены в понятной для начинающих форме.

http://www.qnx.com/developers/docs/6.4.1/neutrino/getting_started/s1_procs.html

Прочесть нужно треть главы до подраздела "Starting a process", если С не пугает, читайте полностью. После прочтения вы будете понимать, что такое process, thread, mutex, priorites, semaphores, scheduler, contex-switch, kernel states.

Ruby

Обзор апи для threads в руби:
http://www.tutorialspoint.com/ruby/ruby_multithreading.htm

Чтобы понять, что такое green threads и gil в руби:
http://www.leonardoborges.com/writings/2008/10/28/understanding-ruby-threads/

Продолжение про gil:
http://ablogaboutcode.com/2012/02/06/the-ruby-global-interpreter-lock/

Теперь у нас есть базовый словарь терминов, чтобы понять разницу в реализации различных руби:
https://blog.engineyard.com/2011/ruby-concurrency-and-you

Теперь добавим в микс fibers и cpu/io-bound:
http://blog.engineyard.com/2010/concurrency-real-and-imagined-in-mri-threads

Теперь чуть подробнее про fibers:
http://paulbarry.com/articles/2010/04/01/fibers-in-ruby-1-9

Пример использования fibers:
http://pragdave.blogs.pragprog.com/pragdave/2007/12/pipelines-using.html

Пример реализации fibers через threads:
https://gist.github.com/tmm1/4631

Event loop:
https://blog.engineyard.com/2011/what-are-events-why-might-you-care-and-how-can-eventmachine-help
https://practicingruby.com/articles/shared/ehiyknnsskrr

Fibers для скрытия event loop колбеков:
http://www.igvita.com/2010/03/22/untangling-evented-code-with-ruby-fibers/
http://blog.paracode.com/2012/09/07/pragmatic-concurrency-with-ruby/

Про синхронизацию:
http://www.confreaks.com/videos/702-rubyconf2011-scaling-ruby-with-actors-or-how-i-learned-to-stop-worrying-and-love-threads
http://confreaks.com/videos/1261-rockymtnruby2012-let-s-talk-concurrency

Про Сelluloid и Sidekiq:
http://www.confreaks.com/videos/1302-rubyconf2012-the-celluloid-ecosystem
http://www.confreaks.com/videos/1290-rubyconf2012-asynchronous-processing-for-fun-and-profit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment