> Brent, David,You are correct, but fairness is not the goal, performance is. If you want fairness, you are welcome to code it. But threads don't file union grievances, and it would be absolute foolishness for a scheduler to sacrifice performance to make threads happier. The scheduler decides which thread runs, you decide what the running thread does. You are expected to use your control over that latter part to exercise whatever your application notion of "fairness" is. Your test program is a classic example of a case where the use of a mutex is inappropriate. Nonsense. The worker thread would be doing work most of the time and wouldn't be holding the mutex. So what? The feeder thread could get the mutex after the mutex is unlocked before the worker thread goes to do work. The only reason your test code encountered a "problem" was because you yielded the CPU while you held the mutex and never used up a timeslice. Nope. You have to create a situation where the mutex is held much more often than not held to get this behavior. That's a pathological case where the use of a mutex is known to be inappropriate. If you want queued locks, feel free to code them and use them. But you have to work very hard to create a case where they are useful. If you find you're holding the mutex more often than not, you're doing something *very* wrong. 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"
| Ingo Molnar | Re: [PATCH 00 of 36] x86/paravirt: groundwork for 64-bit Xen support |
| Linus Torvalds | Linux 2.6.27-rc8 |
| Alan Cox | [PATCH 02/27] drivers/char/hvc_console.c: adjust call to put_tty_driver |
| James Bottomley | Re: Integration of SCST in the mainstream Linux kernel |
git: | |
| Johannes Schindelin | RE: Switching from CVS to GIT |
| Florian v. Savigny | Can git be tweaked to work cross-platform, on FAT32? |
| Shawn Bohrer | [PATCH] Fix off by one error in prep_exclude. |
| Johannes Sixt | [PATCH 03/40] Add target architecture MinGW. |
| Marcos Laufer | dmesg IBM x3650 OpenBSD 4.3 |
| Nick Guenther | Re: Real men don't attack straw men |
| Steve B | Intel Atom and D945GCLF2 |
| Michael | QEMU /dev/tun issue with tun device number > 3 (more than 4 guests) |
| David Miller | [GIT]: Networking |
| Chuck Lever | Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
| Patrick McHardy | gre: minor cleanups in netlink interface |
| Jarek Poplawski | Re: [PATCH] net_sched: Add qdisc __NET_XMIT_STOLEN flag |
