bz2 & cpu usage

Brad Tilley bradtilley at gmail.com
Tue Oct 19 10:08:39 EDT 2004


Stefan Behnel wrote:
> Brad Tilley schrieb:
> 
>> I'd like to keep at least 50% of the cpu free while doing bz2 file 
>> compression. Currently, bz2 compression takes between 80 & 100 percent 
>> of the cpu and the Windows GUI becomes almost useless. How can I lower 
>> the strain on the cpu and still do compression? I'm willing for the 
>> compression process to take longer.
> 
> 
> Three approaches:
> 
> 1) Use a thread for the I/O part (i.e. the de/compression) and another 
> one for the GUI.
> 
> 2) Collect the files first, then handle one after the other and return 
> to the GUI in between.
> 
> 3) Use a non-blocking scheme for the whole thing (may be the trickiest).
> 
> Stefan

The part I wrote about the "Windows GUI" is not clear. I meant the 
Windows XP Desktop. My script has no GUI. Sorry for the mix-up.

Brad



More information about the Python-list mailing list