On Tuesday 23 March 2004 7:13 pm, John Levon wrote:
> On Tue, Mar 23, 2004 at 07:06:30PM +0000, Angus Leeming wrote:
> > > Maybe I misunderstood what you wanted to change in Qt. A "busy
> > > loop" would  be one that chewed CPU despite no events arriving.
> >
> > This is what seems to happen in the Qt-equivalent. We get a
> > never-ending stream of calls to 'someNonTrivialFunction()' when
> > everything else is totally quiet.
>
> Then we definitely want to continue using a timer for this.
>
> > Strategy 1 is to modify the main GUI loop, as above.
> >
> > Strategy 2 is to use a Timeout as we do currently, but use it
> > only to post the callbacks of these 'reaped_children' rather
> > than, as now, using it to both reap the zombies AND post the
> > callbacks.
>
> I prefer the latter.

Me too, if only because hacking into the Qt event loop turns out to be 
a right PITA.

Nonetheless, playing devil's advocate, why is Strategy 2 better than 
the existing strategy of using a Timeout to reap the children also? 
(Genuine question.)

> > Basically, I'm at a bit of a loss. The reaping-children bit
> > appears to be optimized as the handler is invoked only when a
> > SIGCHLD event is emitted. It seems to be a real pity that we
> > can't be similarly efficient when posting the callbacks.
>
> Well, if Qt had support for reaping children...

You're the Qt guru here. If you tell me it doesn't then it doesn't ;-)

> What routines need to know about children that have died?

'I'd rather say 'Completed' than 'Died'. 'Died' is so emotive ;-)

The graphics loading code needs to know that an image file has been 
converted to a loadable format so that it can begin the process of 
loading the thing.

> regards
> john

Angus

Reply via email to