[Python.NET] ANNOUNCE: Python for .NET beta 5 now available

Stan Pinte stan at phidani.be
Thu Mar 31 17:01:22 CEST 2005


Brian Lloyd a écrit :

>>>Forgetting to manage the lock around a callback into Python 
>>>is almost certain to cause a NullReferenceException (because 
>>>there will be no valid thread state when the callback is 
>>>made).
>>> 
>>>
>>>      
>>>
>>Is this take care of when a C# instance calls a delegate, wich is a
>>python function? Or do we need to take the same care? (i.e. wrap the
>>call to the delegate in a AcquireLock/ReleaseLock section).
>>
>>thanks!
>>
>>Stan.
>>    
>>
>
>No, I was just starting to look at your report, and I don't 
>_think_ its the same thing.
>
>When PythonNet creates a delegate with a Python implementation, 
>it generates the actual managed wrapper delegate and includes the 
>necessary calls to AcquireLock() and ReleaseLock().
>
>There are a bunch of unit tests for delegates that don't exhibit 
>this behavior - the main difference I can see is that your 
>delegate runs on a different thread (which shouldn't matter, but 
>its a place to start).
>  
>

be sure to take a look at the comment I have made, because I include a
second python test case, much simpler, without dependancies to Simpy.

thanks a lot Bryan!

>Brian Lloyd        brian at zope.com
>V.P. Engineering   540.361.1716              
>Zope Corporation   http://www.zope.com 
>
>
>
>
>  
>




More information about the PythonDotNet mailing list