Hi

First, let me start by saying that I don't have a lot of experience with Iron 
Python, or Python for that matter, but I know a person involved with the 
current project who is an experienced Python developer, but is unable to help 
with this issue since we believe it has to do with our integration between my 
C# code and his Python code. Also, I am aware that this might not be directly a 
IronPython issue, but it's certainly involving IronPython, NymPy for .net and 
C# and integration between them.

The short version of our problem is that when I call his Python scripts through 
IronPython in a multithreaded context, I get a 
System.InsufficientMemoryException thrown by NumPyDotNet. However, if I run my 
code synchronously on one thread, it works fine.

The long version is that I have a Windows Service that constantly checks in a 
database for new entries that will trigger work to be done (calculating data). 
I need to be able to do the calculation work on another thread in order to not 
lock up the service, making it unresponsive. But calling the Python scripts 
through IronPython on my worker thread results in the exception above. If I run 
my code on one thread, the service is unresponsive during start-up and windows 
terminates it after a certain time, saying it could not put it into its 
"started" state since its locked by work.

I have tried various ways to do my work asynchronous, like starting a Task and 
using the timers in Microsoft's libraries. I have not tried async/await from 
.net 4.5 since upgrading to .net 4.5 is not desireable by the project 
management.

The same problem was explained (not by me) in this stackoverflow post 
http://stackoverflow.com/questions/10003344/ironpython-version-of-numpy-doesnt-work-in-multi-threaded-environment
 but there are very few other similar issues when I search forums.

Any suggestions or tips will be greatly appreciated.

Eirik Årdal / 54°24'42" S 3°25'33" E
Konsulent
Bouvet Norge AS, Solheimsgaten 15, NO-5058 Bergen
Mobil +47 992 999 31
http://www.bouvet.no<http://www.bouvet.no/?utm_source=Signatur%2Bno&utm_medium=Epost&utm_campaign=Bouvet%2Bsignatur>
   eirik.ar...@bouvet.no<mailto:eirik.ar...@bouvet.no>

[bouvetlogomini]

<<inline: image003.jpg>>

_______________________________________________
Ironpython-users mailing list
Ironpython-users@python.org
https://mail.python.org/mailman/listinfo/ironpython-users

Reply via email to