Arjan van de Ven wrote:There are two answers to this. One is that you sometimes are writing POSIX code and Linux-specific optimizations don't change the fact that you still need a portable implementation. The other answer is that futexes don't change anything in this case. In fact, in the last time I hit this, the lock was a futex on Linux. Nevertheless, that doesn't change the basic issue. The lock is locked, you cannot afford to wait for it, but not getting the lock is expensive. The solution is to yield and check the lock again. If it's still held, you dispatch to another thread, but many times, yielding can avoid that. A futex doesn't change the fact that sometimes you can't afford to block on a lock but nevertheless would save significant effort if you were able to acquire it. Odds are the thread that holds it is about to release it anyway. That is, you need something in-between "non-blocking trylock, fail easily" and "blocking lock, do not fail", but you'd rather make forward progress without the lock than actually block/sleep. DS -
| Fernando Luis | [PATCH] affinity is not defined in non-smp kernels - i386 (v2) |
| Andrew Morton | Re: [PATCH 2/2][MTD] Add support for > 2GiB MTD devices |
| Zev Weiss | [PATCH] [MTD] mtdchar.c: Fix regression in MEMGETREGIONINFO ioctl() |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
git: | |
| Dan Farina | backup or mirror a repository |
| Ken Pratt | pack operation is thrashing my server |
| Junio C Hamano | What's cooking in git.git (Aug 2008, #07; Sat, 23) |
| Sverre Rabbelier | Git vs Monotone |
| Richard Stallman | Real men don't attack straw men |
| Richard Daemon | OpenBSD 4.3 running in VirtualBox? Anyone have it working properly? |
| Kent Watsen | Re: vlan trunking with a powerconnect 5224 |
| David Collier-Brown | Re: GPL version 4 |
| Jim Winstead Jr. | Re: Root Disk/Book Disk Compatibility |
| C Wayne Huling | Re: Can males come from... |
| Dong Liu | Re: CXterm for LINUX |
| David Gabrius | Re: NT vs Linux (was: Re: truth or dare) |
