> what if you have an infinite number of items on one side and finiteThere is no such thing as a "fair share" when comparing an infinite quantity to a finite quantity. It is just as sensible to do 1 then 1 as 10 then 10 or a billion then 1. What I would do in this case is work on one side for one timeslice then the other side for one timeslice, continuuing until either side was finished, then I'd work exclusively on the other side. This is precisely the purpose for having timeslices in a scheduler. The timeslice is carefully chosen so that it's not so long that you ignore a side for too long. It's also carefully chosen so that it's not so short that you spend all your time switching swides. What sane schedulers do is assume that you want to make as much forward progress as quickly as possible. This means getting as many work units done per unit time as possible. This means as few context switches as possible. A scheduler that switches significantly more often than once per timeslice with a load like this is *broken*. The purpose of the timeslice is to place an upper bound on the number of context switches in cases where forward progress can be made on more than one process. An ideal scheduler would not switch more often than once per timeslice unless it could not make further forward progress. Real-world schedulers actually may allow one side to pre-empt the other, and may switch a bit more often than a scheduler that's "ideal" in the sense described above. This is done in an attempt to boost interactive performance. But your basic assumption that strict alternation is desirable is massively wrong. That's the *worst* *possible* outcome. DS _______________________________________________ freebsd-threads@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-threads To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org"
| Arjan van de Ven | [patch] Add basic sanity checks to the syscall execution patch |
| Andi Kleen | [PATCH CPA] [1/28] Shrink __PAGE_KERNEL/__PAGE_KERNEL_EXEC on non PAE kernels |
| Alex Dubov | Re: [2.6.20] tifm_7xx1/mmc not working |
| Jared Hulbert | [PATCH 00/10] AXFS: Advanced XIP filesystem |
git: | |
| Junio C Hamano | More precise tag following |
| walt | git versus CVS (versus bk) |
| Stephen R. van den Berg | RFC: grafts generalised |
| Pierre Habouzit | [PATCH 1/2] Add strbuf_cmp. |
| Richard Stallman | Real men don't attack straw men |
| K K | Re: No Blob without Puffy |
| Stephan A. Rickauer | Re: Net-SNMP segfaults under OpenBSD 4.3 |
| Brian A. Seklecki | sshd_config(5) PermitRootLogin yes |
| Jim Winstead Jr. | Re: Root Disk/Book Disk Compatibility |
| Howard Wei-Hao Pan | [Q] Does Linux work with PCMCIA devices? |
| Curtis Yarvin | Re: Problem with UNCOMPRESS |
| Ross Sponholtz | Re: S3 |
