On Thu, 21 Jun 2007, Ingo Molnar wrote:I'm pretty sure others do it too. Maybe not on an OS level (but I actually doubt that - I'd be surprised if Windows doesn't do the exact same thing), but I know for a fact that a lot of people in threaded libraries end up depending very much on the "simple store closes a locked section". Just googling for "xchg" "mov" "spinlock" "-linux" shows discussion boards for Windows developers with open-coded spinlocks like int ResourceFlag = 0; // 0=Free, 1=Inuse ... // Wait until we get the resource while(InterlockedExchange(&ResourceFlag, 1) != 0) { Sleep(0); } // Wait a tad // Have the resource ... // do your thing ResourceFlag = 0; // Release the resource and that's definitely Windows code, not some Linux person doing it. And this is from an OS2 forum unsigned owned=0; void request() { while(LockedExchanged(&owned,1)!=0) ; } void release() { owned = 0; } so it's not even something unusual. So while arguably these people don't know (and don't care) about subtle issues like memory ordering, I can *guarantee* that a lot of programs depend on them, even if that dependency may often come from a lack of knowledge, rather than actively understanding what we do like in the Linux kernel community. (And yes, they rely on compilers not reordering either. Tough.) Linus -
| Linus Torvalds | Linux 2.6.27-rc8 |
| Greg KH | [patch 00/71] 2.6.26-stable review |
| Dmitry Torokhov | 2.6.27-rc8+ - first impressions |
| Rafael J. Wysocki | [Bug #11215] INFO: possible recursive locking detected ps2 command |
git: | |
| Christian MICHON | Re: MinGW port - initial work uploaded |
| Luiz Fernando N. Capitulino | Libification project (SoC) |
| Linus Torvalds | People unaware of the importance of "git gc"? |
| Jakub Narebski | [RFC] Git User's Survey 2008 |
| Richard Stallman | Real men don't attack straw men |
| Tony Abernethy | Re: What is our ultimate goal?? |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| James Hartley | scp batch mode? |
| Ingo Molnar | Re: [TCP]: TCP_DEFER_ACCEPT causes leak sockets |
| Timo Teräs | Re: xfrm_state locking regression... |
| Ingo Molnar | Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+ |
| Natalie Protasevich | [BUG] New Kernel Bugs |
