タグ

rubyとconcurrentに関するHashのブックマーク (5)

  • Ruby Fibers: 8 Useful Reads On Ruby’s New Concurrency Feature

    Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news. New to Ruby 1.9 is the concept of fibers. Fibers are light-weight (green) threads with manual, cooperative scheduling, rather than the preemptive scheduling of Ruby 1.8's threads. Since Ruby 1.9's threads exist at the system level, fibers are, in a way, Ruby 1.9's answer to Ruby 1.8's green threads, but lacking the pre-emp

  • Fibers & Cooperative Scheduling in Ruby - igvita.com

    By Ilya Grigorik on May 13, 2009 Continuations have been a part of the Ruby API for quite some time, but for a variety of reasons have not seen much practical use: early Ruby 1.8 implementations suffered from serious memory leak problems, which were consequently mostly resolved, and the somewhat academic nature of the concept didn't help either. However, with the production versions of Ruby 1.9 ou

  • Lessons Learned in Concurrency with Ruby - Part I

    The Engine Yard PaaS products are highly complex, and span thousands of servers to serve our customers. Ensuring that our applications run quickly and reliably requires a good understanding of concurrency and parallelization. This blog post is a recap of my journey down the rabbit hole of concurrency in an attempt to solve this problem in my own development efforts. Part II will be the continuatio

    Lessons Learned in Concurrency with Ruby - Part I
    Hash
    Hash 2014/08/29
    わかりやすい
  • 開発メモ: KCのRubyバインディングの並列化

    Kyoto CabinetRubyバインディングの使い方については以前の記事で説明してあるが、今回はそこで触れていた並列化をやってみたという話。 Ruby 1.9のスレッドモデル Ruby 1.9のマニュアルには以下のように書いてある。 ネイティブスレッドを用いて実装されていますが、現在の実装では Ruby VM は Giant VM lock (GVL) を有しており、同時に実行されるネイティブスレッドは常にひとつです。ただし、IO 関連のブロックする可能性があるシステムコールを行う場合には GVL を解放します。その場合にはスレッドは同時に実行され得ます。また拡張ライブラリから GVL を操作できるので、複数のスレッドを同時に実行するような拡張ライブラリは作成可能です。 ということは、DBMの操作をGVLを外してから行ってあげれば、DBMの操作同士およびDBMの操作とRubyコードの

    Hash
    Hash 2014/08/28
    “普通は直列処理(というか、並列でない並行処理)しかできないRubyプログラムであるが、DBなどのIO系のネイティブな処理は並列化して実行できる。”
  • irbから学ぶRubyの並列処理 ~ forkからWebSocketまで

    (追記:2012-12-13) 記事を電子書籍化しました。「Gumroad」を通して100円にて販売しています。内容についての追加・変更はありませんが、文体の変更、誤記の修正およびメディア向けの調整を行っています。 電子書籍「irbから学ぶRubyの並列処理 ~ forkからWebSocketまで」EPUB版 このリンクはGumroadにおける商品購入リンクになっています。クリックすると、オーバーレイ・ウインドウが立ち上がって、この場でクレジットカード決済による購入が可能です。購入にはクレジット情報およびメールアドレスの入力が必要になります。購入すると、入力したメールアドレスにコンテンツのDLリンクが送られてきます。 購入ご検討のほどよろしくお願いしますm(__)m 関連記事: 電子書籍「irbから学ぶRubyの並列処理 ~ forkからWebSocketまで」EPUB版をGumroad

    Hash
    Hash 2012/06/12
    irbやgosh, gchiなどの対話的実行環境 = Read Eval Print Loop. その名の通り. loop{puts eval gets}で基本的な動きをエミュレートできる。あとこれをforkしたりごにょごにょ。すげーわかりやすい
  • 1