From: Mauricio Fernandez Date: 2006-07-21T01:14:12+09:00 Subject: Re: [ANN] sandbox 0.0.11 -- taking the i out of eval On Fri, Jul 21, 2006 at 12:51:12AM +0900, Joshua Haberman wrote: > On Fri, Jul 21, 2006 at 12:30:14AM +0900, why the lucky stiff wrote: > > To be stable, I might need to enhance Thread. For now is there a way to > > prevent thread calls? To prevent crashes, I might need to pause threads > > until the Sandbox is complete. Then I will give Sandbox.timeout which > > gives a maximum execution time. > > I don't want to diss your work, since it is obviously a significant > accomplishment. But aren't these problems symptoms of the fact that the > approach (swapping out global variables) is sort of a hack? Wouldn't > all these problems disappear if you did this the "right" way, by making > these globals into members of a structure that get passed to every > function (eg. make the parser re-entrant)? This is exactly what was done in Sydney. I know know of any plan to bring that to HEAD though (and there's no way it could get in ruby_1_8). YARV is doing (or will do, haven't checked for a while) native threads, but I don't know if it's reentrant or just using a global interpreter lock like Python. -- Mauricio Fernandez - http://eigenclass.org - singular Ruby