[Python.NET] RE: Python for .NET, multithreading case.

Duong, Thuy tduong at alarismed.com
Thu Feb 24 09:02:39 CET 2005


Hi Brian,

Sorry for the late reply.

I've attached the Python script (_M4.py) which invokes the .NET DLL.
Basically, the following happens:

1) Create a "main" thread called:  Main Thread
2) Main Thread can successfully invoke the function: GetOne() in our .NET DLL.
GetOne() simply prints:  "Entering the C# static function GetOne()"
and returns "1".
3) Main Thread now spawns a child thread: Child Thread 
4) Child Thread unsuccessfully invokes the .NET DLL. 
When we wrote to the console, we see Child Thread entering into GetOne() but 
the control never returns back to Child Thread after that. 


Below is the actual console print out when I ran the script.

===>
 

D:\PythonNet-1.0-beta4>python _m4.py
Entering the C# static function GetOne()
Main Thread - GetOne() 1
######init MessageRouter
######run MessageRouter - Child Thread
Child Thread starts
Entering the C# static function GetOne()

===>

Thanks for looking into this.

  -thuy

-----Original Message-----
From: Brian Lloyd
To: Duong, Thuy; pythondotnet at python.org
Cc: vantuando at computer.org; Smith, Daniel
Sent: 2/22/2005 10:16 AM
Subject: RE: Python for .NET, multithreading case.

If you can post (or email me directly) the Python code 
that you use to create the threads, that would help me 
in making a test case (just to make sure any subtle 
differences aren't lost...)  -Thanks


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

> -----Original Message-----
> From: Duong, Thuy [mailto:tduong at alarismed.com] 
> Sent: Tuesday, February 22, 2005 12:50 PM
> To: Brian Lloyd; pythondotnet at python.org
> Cc: vantuando at computer.org; Smith, Daniel
> Subject: RE: Python for .NET, multithreading case.
> 
> Hi Brian,
> 
> Thanks for getting back to us so promptly!
> 
> The threads (ThreadA and Threadaa) are created from Python and invoke
> the .NET DLL.
> 
> Pls. let us know if you need any additional information.
> 
> Thanks.
> 
>   -thuy
> 
> -----Original Message-----
> From: Brian Lloyd [mailto:brian at zope.com] 
> Sent: Tuesday, February 22, 2005 6:39 AM
> To: Duong, Thuy; pythondotnet at python.org
> Cc: Smith, Don S. (ALARIS); vantuando at computer.org
> Subject: RE: Python for .NET, multithreading case.
> 
> 
> Just to clarify - are you creating these threads from 
> Python or from managed code?
> 
> 
> Brian Lloyd        brian at zope.com
> V.P. Engineering   540.361.1716              
> Zope Corporation   http://www.zope.com 
> 
> 
> > -----Original Message-----
> > From: Duong, Thuy [mailto:tduong at alarismed.com]
> > Sent: Saturday, February 19, 2005 6:29 PM
> > To: pythondotnet at python.org; brian at zope.com
> > Cc: Smith, Don S. (ALARIS); vantuando at computer.org
> > Subject: Python for .NET, multithreading case.
> > 
> > 
> > Hi Brian,
> > 
> > We've been using Python for .NET and it's been working pretty
> > well interacting
> > with a .NET DLL.  However, we've encountered some problems with 
> > this multithreading
> > scenario:
> > 
> > 1) Create a "main" thread called:  ThreadA
> > 2) ThreadA can successfully invoke our .NET DLL.
> > 3) ThreadA now spawns a child thread: Threadaa
> > 4) Threadaa unsuccessfully invokes the .NET DLL.
> > When we wrote to the console, we see Threadaa invoke the 
> .NET DLL but 
> > the control never returns back to Threadaa after the .NET DLL call.
> > 
> > Do you have any thoughts on this and do you have any suggestions? 
> > Thanks in advance for your help!
> > 
> > 
> > Regards,
> > 
> >   Thuy Duong
> > 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: _M4.py
Type: application/octet-stream
Size: 2222 bytes
Desc: _M4.py
Url : http://mail.python.org/pipermail/pythondotnet/attachments/20050224/038402a2/_M4.obj


More information about the PythonDotNet mailing list