<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2604" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Great, Brian. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I successfully reproduced the state with a very
simple application. Here is very dumb python program that uses the
CLR:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>from CLR.System import String</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>class cSharpCaller( object ):<BR>
def __init__( self ):<BR> print
"Created a cSharpCaller instance"<BR>
self.__cSharpString = None</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> def createCSharpString( self,
str ):<BR> self.__cSharpString =
String( str )</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> def returnCSharpString( self
):<BR> return
self.__cSharpString.ToString()<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>And if I test this with this (dumb) threethreaded
testprogram:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>import threading, thread, time</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>from cSharpCaller import cSharpCaller </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>def start_threads(amount=5):<BR>
for i in range(amount):<BR>
thread = threading.Thread(target=process_thread
)<BR> print "starting thread ",
thread.getName()<BR>
thread.start()</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>def process_thread( ):<BR>
print "thread started "<BR> for i in range( 2
):<BR> print "Hi, I'm a
thread"<BR> time.sleep( 1
)<BR> cs = cSharpCaller( )<BR>
cs.createCSharpString( "created from a thread" )<BR> print
"cs.returnCSharpString() = ", cs.returnCSharpString()<BR>
print "thread %s ended"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>start_threads( 3 )</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I get this output:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>starting thread thread0<BR>thread
started<BR>Hi, I'm thread %s<BR>starting thread thread1<BR>thread
started<BR>Hi, I'm thread %s<BR>starting thread thread2<BR>thread
started<BR>Hi, I'm thread %s<BR>Hi, I'm thread %s<BR>Hi, I'm thread %s<BR>Hi,
I'm thread %s<BR>Created a cSharpCaller instance<BR>Created a cSharpCaller
instance<BR>cs.returnCSharpString() =</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>and I have to CTRL+Pause to get out of the hang.
Clearly hangs on the first String.ToString() method call. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Regards, </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Torgeir</FONT></DIV>
<DIV><FONT face=Arial size=2> </DIV></FONT></BODY></HTML>