Arlen Cuss
10/2/2007 3:24:00 PM
Hi,
On Tue, 2007-10-02 at 20:44 +0900, Chris Bailey wrote:
> I'm having a bit of a problem accessing variables in an instance of GServer.
> What I would like to do is make a hash that is effectively global to the
> current thread.
This is just a random thought, but what about a class-level hash where
the running thread (Thread.current) is the key?
e.g.
class TestServer#..
@@thingy = {}
.....
protected
def test_hash
@@thingy[Thread.current]
end
def test_hash= m
@@thingy[Thread.current] = m
end
end
I'm not sure about locking (which is probably only relevant at the level
of test_hash=), but it may be worth a look
Just a thought.
- Arlen