From: ts Date: 2003-08-13T00:53:30+09:00 Subject: Re: $SAFE = 5 and Safe Ruby Misleading? >>>>> "D" == Dave Fayram writes: D> Basically, can I evaluate something in a $SAFE = 4 thread, then get it D> out and work with it meaningfully? The only way I can think of is to D> try analyzing it in a $SAFE = 3 thread, where an object can't untaint D> itself, but doing so for an object would be pretty much impossible. No, the only way to do it is to make the analysis at $SAFE = 4 and return an object with a known class. Never try to interpret at a lower level the result of a block evaluated at level 4. You have an example of such mechanism in plruby (but it's written in C). When plruby run with a timeout, it has 3 threads : * main thread (level 3) * timeout thread (level 3) * user thread (level 4) All evaluations are made in the user thread, and the user thread must return a valid object which is valided at level 4. The main thread never try to evaluate some code, it just expect a valid object. Guy Decoux