Ruby Wait and Signal -
i have two threads in ruby process. want have one sleep , other send signal wake up.
i know how mutex , conditionalvariables, don't have critic section run it's not right solution.
i know how thread stop , thread run, on thread stops , other calls run on it, it's i'm looking for.
is there other way? i'm trying accomplish have on thread wait content in database , other notify when there content.
maybe work?
require "thread" q = queue.new thread.new sleep 10 q.push "*" end p q.pop
Comments
Post a Comment