[py-dev] execnet: redirecting stdout and stderr from remote threads

holger krekel holger at merlinux.eu
Fri Jul 10 13:23:52 CEST 2009


On Fri, Jul 10, 2009 at 21:16 +1000, Gordon Wrigley wrote:
> > yes, might make sense then.  I attached a working example
> > how to do general output redirection, maybe that helps you.
> 
> I gave the example a look over and it all makes sense and is nice and
> straight forward. So far I've maintained a 1 to 1 relation ship
> between threads and channels, in the context of the example are there
> any threading implications to having multiple threads calling into the
> channel file that has been assigned to sys.stdout?

no problems i am aware off.  It *should* be safe to have
multiple threads using channel.send() concurrently. 
It depends on write()s to pipes (or sockets) being 
atomic eventually which i think they are.  

One issue that can pop up is tearing down the whole
machinery cleanly - that can sometimes be more
involved and i believe execnet still might need 
some more work there. 

holger

-- 
Metaprogramming, Python, Testing: http://tetamap.wordpress.com
Python, PyPy, pytest contracting: http://merlinux.eu 



More information about the Pytest-dev mailing list