[PATCH 1/2] Add function to map functions on items in the main thread
Brian C. Lane
bcl at redhat.com
Wed Nov 13 16:06:02 UTC 2013
On Wed, Nov 13, 2013 at 08:14:20AM +0100, Vratislav Podzimek wrote:
> On Tue, 2013-11-12 at 08:48 -0800, Brian C. Lane wrote:
> > I think you can drop the batch size. Just run them until the queue is
> > empty or you run out of time. By batching them up you make the delay
> > more granular, especially if the items being processed have different
> > runtimes.
> Well, I wanted to avoid getting, subtracting and comparing time with
> every item being processed. That's why I used the batch size and I'd
> really like to keep it there. In case there is an action like you
> describe, the caller may use batch_size=1 delivering such behaviour and
> causing basically no overhead due to the nature of xrange.
I don't think you're going to see any kind of significant impact from
checking the time after every item. But yes, setting the size to 1 would
also accomplish this.
My main concern is that by having the batching in there it is
prioritizing completing the tasks over GUI responsiveness, and I think
locking up the UI should be avoided as much as possible, even if running
the tasks take longer.
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
More information about the anaconda-patches
mailing list