From: Eero Saynatkari Date: 2006-01-25T12:12:06+09:00 Subject: Re: local variables and threads Russell Fulton wrote: > > Is there a way to ensure that a particular variable really is local to a > thread block? I have a problem with a threaded program that would be > explained if one of the local variable was actually global. I've > checked everything I can think of... > > I miss my and local from perl which allowed me to explicitly control the > scope of variables. Only variables prefixed with $ are global ($var and so on). It is, however, certainly possible to have shared locals if you have something like some_var t1 = Thread.new { ... } t2 = Thread.new { ... } Any variables that you define inside the thread block will be local to that thread, though. > Russell. E -- Posted via http://www.ruby-forum.com/.