This is when the said process will invoke thread lock and respectively crash Rhino.
How can I avoid this crash?
UPDATE:
How would this:
using System.Threading;
new Thread(() =>
{
Thread.CurrentThread.IsBackground = true;
/* run your code here */
Console.WriteLine("Hello, world");
}).Start();
look like in IronPython?
I’m particularly confused with the lambda operator there.
from System.Threading import Thread, ParameterizedThreadStart
def prnt(o): # having a single argument is important, even if it's not used :D
System.Console.WriteLine("Hello, world")
t = Thread(ParameterizedThreadStart(prnt))
t.Start()
from System.Threading import Thread, ParameterizedThreadStart
z = ""
def prnt(o): # having a single argument is important, even if it's not used :D
print("Hello, world")
global z
z = "some value"
#return "some value"
t = Thread(ParameterizedThreadStart(prnt))
t.Start()
print "z={}".format(z)
Should be straightforward understandble in c# (though I don’t speak csharp much :P)
from System.Threading import Thread, ParameterizedThreadStart
import scriptcontext as sc
sc.sticky['z'] = ''
def prnt(o): # having a single argument is important, even if it's not used :D
print("Hello, world")
sc.sticky['z'] = "some value"
#return "some value"
t = Thread(ParameterizedThreadStart(prnt))
t.Start()
for i in range(10):
print(i)
print "z={}".format(sc.sticky['z'])
Python seems to do some freaky stuff here… In C# that execution order does not happen. Perhaps the Python guys in the forum can be best of help here for you, since my python knowledge is not as good (plus I don’t like python so much lol…) @Helvetosaur maybe he is the guy, I would tag Dale as well, but I dont know if we should be bothering him with this.