On Sun, 25 Nov 2007 21:46:26 PST, kernel coder said:The trick is to write your code so it doesn't *matter* if other code runs. For example - the timer interrupt almost certainly doesn't look at or modify any of *your* code's variables. So 98% of the kernel's code you don't even have to *care* if it runs (as long as you aren't doing something real-time or has similar response-time or throughput constraints). And if you are worried about that other 2%, where related code, for example the IRQ handler for a network interface, may have to look at and/or modify some of your variables, that's when you should be using appropriate locking - there's mutexes, semaphores, the whole RCU family, and more - none of which I'll attempt to explain, because I'm not all that good at that stuff. Basic rule of thumb - if you have something that will break if two things access it at the same time, put a lock around it, so they take turns.
| debian developer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| H. Peter Anvin | Re: [PATCH] x86: Construct 32 bit boot time page tables in native format. |
| Christoph Lameter | Re: [RFC 00/15] x86_64: Optimize percpu accesses |
git: | |
| Christoph Hellwig | Re: [PATCH 06/32] IGET: Mark iget() and read_inode() as being obsolete [try #2] |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | [GIT]: Networking |
