Forum: IronRuby DLR hosting

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1e39a948a58f4569c53d971c2e120920?d=identicon&s=25 Ivan Porto carrero (casualjim)
on 2009-01-30 13:47
(Received via mailing list)
it will show that so far I've been working with instead of on IronRuby
:)
And then I've been focussed on using the Ruby language and .NET from
Ruby
instead of using C# to host Ironruby.
I'm using a debug build from IronRuby and the weird thing is that I have
to
add ClassHierarchyLocker.

            var controllerRubyClass =
ScriptRuntime.Globals.GetVariable<RubyModule>(controllerRubyClassName);
            string controllerRubyMethodName = null;
            using (rubyContext.ClassHierarchyLocker())
            {
                controllerRubyClass.EnumerateMethods((_, symbolId, __)
=>
                                                         {
                                                             if
(String.Equals(symbolId, actionName,

StringComparison.OrdinalIgnoreCase))
                                                             {

controllerRubyMethodName = symbolId;
                                                                 return
true;
                                                             }
                                                             return
false;
                                                         });
            }

The question I have here is: Why do I need the ClassHierarchyLocker ?

Cheers Ivan
F983f0c990cba2fe743ef62a975ec99c?d=identicon&s=25 Curt Hagenlocher (Guest)
on 2009-01-30 14:48
(Received via mailing list)
It's part of Tomas' thread-safety work.  To enumerate the methods
safely, you need to ensure that another thread isn't modifying the
method list.

From: ironruby-core-bounces@rubyforge.org
[mailto:ironruby-core-bounces@rubyforge.org] On Behalf Of Ivan Porto
Carrero
Sent: Friday, January 30, 2009 4:47 AM
To: ironruby-core@rubyforge.org
Subject: [Ironruby-core] DLR hosting

it will show that so far I've been working with instead of on IronRuby
:) And then I've been focussed on using the Ruby language and .NET from
Ruby instead of using C# to host Ironruby.

I'm using a debug build from IronRuby and the weird thing is that I have
to add ClassHierarchyLocker.

            var controllerRubyClass =
ScriptRuntime.Globals.GetVariable<RubyModule>(controllerRubyClassName);
            string controllerRubyMethodName = null;
            using (rubyContext.ClassHierarchyLocker())
            {
                controllerRubyClass.EnumerateMethods((_, symbolId, __)
=>
                                                         {
                                                             if
(String.Equals(symbolId, actionName,
                                                                               StringComparison.OrdinalIgnoreCase))
                                                             {
                                                                 controllerRubyMethodName
= symbolId;
                                                                 return
true;
                                                             }
                                                             return
false;
                                                         });
            }

The question I have here is: Why do I need the ClassHierarchyLocker ?

Cheers Ivan
This topic is locked and can not be replied to.