[p4python] P4Python P4 blocks main thread.

Sven Erik Knop sknop at perforce.com
Tue Sep 2 01:33:50 PDT 2008

Hi Shrek,

The standard API or P4 from the command line will load the file printed 
with "p4 print" in small chunks and update your local file or stdout 
P4Python works differently: it loads everything into memory first and 
then gives you the result. For very large files, this can be 
counterproductive. I would recommend that you spawn a separate process 
in this case, connect to processes output and run "p4 print" in it.

There is also a memory leak in P4Python 2007.3 that might cause you 
problems. You might want to update to 2008.1 to avoid this memory leak.

Let me know if this helps or if you need further details.

Kind regards,

Sven Erik

Shrek Zhou wrote:
> Hi, all.
> I used the latest P4Python,* P4Python as a supported product as of 
> 2007.3 <http://www.perforce.com/perforce/loadsupp.html#api>.
> *but when using thread, p4.run_print() just block the main thread if 
> the file to be printed is large.*
> *any ideas?*
> *
> Thanks
> --Shrek*
> *
> ------------------------------------------------------------------------
> _______________________________________________
> p4python mailing list
> p4python at perforce.com
> http://maillist.perforce.com/mailman/listinfo/p4python
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.perforce.com/pipermail/p4python/attachments/20080902/b86a2077/attachment-0001.html>

More information about the p4python mailing list