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

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -