Messages in this thread | | | From | Don Mullis <> | Subject | Re: [PATCH 1/2] lib: more scalable list_sort() | Date | Sun, 24 Jan 2010 14:38:15 -0800 |
| |
Artem Bityutskiy <dedekind1@gmail.com> writes:
> Don made IMO a good proposal for the caller to add cond_reshed() in its > 'cmp()' callback, if needed. Shouldn't that work fine?
In the list_sort() implementation I posted, there was an O(n) loop that contained no calls back to cmp(). The V2 implementation I'm testing right now fixes that -- all inner loops will call back to cmp(). It's also a bit faster, though ~100 bytes bigger.
If there's any other objection to pushing responsibility for calling cond_resched() back to the client, via the cmp() routine, please, let's hear it.
| |