on 15/05/2008 15:57 David Xu said the following:David, did you examine or try the small program that I sent before? The "lucky" thread slept for 1 second each time it held mutex. So in total it spent about 8 seconds sleeping and holding the mutex. And the "unlucky" thread, consequently, spent 8 seconds blocked waiting for that mutex. And it didn't get "lucky". Yes, technically the "lucky" thread was not running while holding the mutex, so probably this is why scheduling algorithm didn't immediately work. I did more testing and see that the "unlucky" thread eventually gets a chance (eventually means after very many lock/unlock cycles), but I think that it is penalized too much still. I wonder if with current code it is possible and easy to make this behavior more deterministic. Maybe something like the following: if (oldest_waiter.wait_time < X) do what we do now... else go into kernel for possible switch I have very little idea about unit and value of X. I almost agree. But I still wouldn't take your last statement for a fact. "Dreadful performance" - on micro-scale maybe, not necessarily on macro scale. After all, never switching context would be the best performance for a single CPU-bound task, but you wouldn't think that this is the best performance for the whole system. As a data point: it seems that current Linux threading library is not significantly worse than libthr, but my small test program on Fedora 7 works to my expectations. -- Andriy Gapon _______________________________________________ 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"
| Con Kolivas | Re: [REPORT] cfs-v4 vs sd-0.44 |
| Tim Tassonis | reiser4 for 2.6.27-rc1 |
| Eric Sandeen | [PATCH 4/4] ext4: call blkdev_issue_flush on fsync |
| Greg Kroah-Hartman | [PATCH 006/196] Chinese: add translation of oops-tracing.txt |
git: | |
| Junichi Uekawa | Re: [ANNOUNCE] GIT 1.5.4 |
| Mark Levedahl | rc4 - make quick-install-doc is broken |
| Ingo Molnar | [OT] Your branch is ahead of the tracked remote branch 'origin/master' by 50 commi... |
| Junio C Hamano | Re: Decompression speed: zip vs lzo |
| Richard Stallman | Real men don't attack straw men |
| Girish Venkatachalam | Thinkpad t61 OpenBSD support? |
| David Newman | setting dscp or tos bits |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Radu Rendec | Endianness problem with u32 classifier hash masks |
| Bruno Randolf | [PATCH] add macro for printing mac addresses |
| Ilpo Järvinen | [RFC PATCH 6/8] [NET]: uninline skb_trim, de-bloats |
| Jeff Kirsher | [NET-NEXT PATCH 0/9] e1000: update and cleanups |
