Re: [paramiko] Multithreading

2010-07-01 Thread Marcin Krol
james bardin wrote: The main loop is a busy loop! It's hogging the GIL itself, and pegging a cpu core at %100. Because the threads only do work with a lock, there is no time for the GIL to switch threads., The sleep() simply allows a few cycles for the GIL to be released. Oops! I didn't

Re: [paramiko] Multithreading

2010-07-01 Thread james bardin
On Thu, Jul 1, 2010 at 12:06 PM, Nikolaus Rath nikol...@rath.org wrote: You can share it, like you can share anything you want between threads, you need proper locking, as the client only has one channel for communication. Since I can share anything I want if I synchronize access to it

Re: [paramiko] Multithreading

2010-07-01 Thread Nikolaus Rath
On 07/01/2010 12:43 PM, james bardin wrote: On Thu, Jul 1, 2010 at 12:06 PM, Nikolaus Rath nikol...@rath.org wrote: You can share it, like you can share anything you want between threads, you need proper locking, as the client only has one channel for communication. Since I can share

Re: [paramiko] Multithreading

2010-07-01 Thread Nikolaus Rath
On 07/01/2010 01:28 PM, james bardin wrote: On Thu, Jul 1, 2010 at 1:00 PM, Nikolaus Rathnikol...@rath.org wrote: Generally in python, the only objects you can share without explicit locking are single instances of core data types - basically lists and dicts. As well as third-party modules