
thread
hexudong08
web开发者,擅长ruby,js,jqueyr,java开发
展开
-
Rails源代码研读之ActiveRecord研读
ActiveRecord 的 connection_poll 使用了 Monit class Reaper attr_reader :pool, :frequency def initialize(pool, frequency) @pool = pool @frequency = frequency原创 2012-06-10 17:44:43 · 1039 阅读 · 0 评论 -
Ruby简单的生产者,消费者模式的实现
require 'thread' q = Queue.new producter = Thread.new { 10.times { |i| q.push i sleep 1 } q.push nil } consumer = Thread.new { loop { i = q.pop break if i == nil puts i转载 2012-09-26 16:30:07 · 781 阅读 · 0 评论