Subject: Re: POW: speed up bulk spell checking
From: Ben Mesman (b.mesman@snow.nl)
Date: Wed Aug 29 2001 - 05:25:18 CDT
>
> Yes. Once can set the priority but that leaves the problem of how to avoid
> 100% CPU useage.
>
> Here is an idea. If the function called by ->fire() return false, the
> function is removed from the gtk_idle queue.
>
> For a background spellchecking, after each block is spell-checked, the
> function could return true if there was another block in the queue and
> false if not.
>
> Spell-checking would be restarted via a timer::set() or timer::start() and
> continue until all the blocks are spell checked.
>
> What do think?
I think this is not a good idea. This is because this is very platform
dependant. If there is a similar mechanism in Win32, it will probably
not remove the function from the queue if it returns false).
It would (probably) be better to do proper bookkeeping on the timers
and remove a function from the idle queue if there is nothing to do. I
included a patch to do just this. The patch may also build on Win32,
because I implemented a 'dummy' , maybe someone can replace it with
something better?
Please have a look and comment on anything that could be done better.
Cheers,
Ben.
-- Ben Mesman Snow b.v. - Unix consultants & OO developers The Amazing Snowmen Produktgroep Open Source
This archive was generated by hypermail 2b25 : Wed Aug 29 2001 - 05:25:38 CDT