On Sun, Feb 24, 2013 at 2:30 AM, Abhijit Sarkar <[email protected]> wrote:
> Bump!
> A problem unsolved keeps bugging me, I seriously hope the great minds
> here would have something for me.

Just so we are sure we are all on the same level, can you please
repost the current version of the code?  It may also help to get a
github account (free) and post all files in a single gist. That would
also allow for version tracking.  It would also be help readability to
get rid of all the comments which contain alternative code.

I rechecked your posts and this seems to be the most recent version:
http://www.ruby-forum.com/attachment/8132/orange_tree.rb

I haven't fully understood what you are trying to do here but a few
things occurred to me

- OrangeTree apparently is the shared resource yet it does not include
any synchronization logic.
- you create the Worker inside Worker class context. While that may
actually work it's simpler to read to have your main program logic on
the top level.
- You have picked bad names for condition variables which convey
nothing about their intended semantics.
- Insert this line at the top of the script and you'll know what's going on:

Thread.abort_on_exception = true

Could be that you hit this bug - although I'd be surprised. What
version are you using.
https://bugs.ruby-lang.org/issues/6288

Kind regards

robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

-- 
[email protected] | 
https://groups.google.com/d/forum/ruby-talk-google?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"ruby-talk-google" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to