Linus Torvalds Answers Your Questions 326
Monday you had a chance to ask Linus Torvalds any question you wanted. We sent him a dozen of the highest rated and below you'll see what he has to say about computers, programming, books, and copyrights. He also talks about what he would have done differently with Linux if he had to do it all over again. Hint: it rhymes with nothing.
The Absolute Death of Software Copyright? by eldavojohn
Recently you spoke out about software patents and the patent process. But I was interested in what you said about how "nasty" copyright issues could get. You use SCO as the obvious nightmare case but what about violations against open source licenses like the GPLv3? Would you care if someone forked the Linux kernel and made major modifications to it and started selling it without releasing the code to the customers? What does your ideal situation look like for open source and commercial closed source? Would you just copy the Finnish model and aren't you afraid American experts are just as daft as American juries?
Linus: So I like copyrights, and even on patents I'm not necessarily in the "Patents are completely evil" camp. When I rant about patents or copyrights, I rant against the *excesses* and the bad policies, not about them existing in the first place.
The patent problems people on slashdot are probably familiar with: the system is pretty much geared towards people abusing it, with absolutely ridiculous patents being admitted, and it hindering invention rather than helping it. The failures are many, and I don't know how to fix it, but much stricter limits on what can be patented are clearly needed.
People were apparently surprised by me saying that copyrights had problems too. I don't understand why people were that surprised, but I understand even *less* why people then thought that "copyrights have problems" would imply "copyright protection should be abolished". The second doesn't follow at all.
Quite frankly, there are a lot of f*cking morons on the internet.
Anyway, the problems with copyright come from absurdly long protection periods, and some overly crazy enforcement. And don't get me wrong: I don't actually think that these problems show up all that much in the software industry. The case of SCO was not, I think, so much a failure of copyright law itself: sure, it was annoying, but at the same time it was really more about a psychopathic company with a failed business that tried to game the system. Tried, and lost. And yes, that fiasco took much too long, and was much too expensive, and should have been shut down immediately, but that whole "using the law for harassment" in the US is a separate issue independent of the copyright issues.
No, when I stated that copyright protection is too strong, I was talking about things like "life of author+70 years" and the corporate 95-year version. That's *ridiculous*. Couple that with the difficulty of judging fair use etc, and it really hinders things like archival of material, making of documentaries, yadda yadda...
So I personally think that IP protection isn't evil in itself - but that it turns evil when it is taken too far. And both patent protection and copyright protection has been taken much much too far.
Scale the term limits back to fifteen years or so, and copyrights would be much better.
When I'm designing a processor for Linux.
by Art Popp (29075)
I spend some time designing things in Verilog and trying to read other people's source code at opencores.org, and I recall you did some work at Transmeta. For some time I've had a list of instructions that could be added to processors that would be drastically speed up common functions, and SSE 4.2 includes some of my favorites, the dqword string comparison instructions. So...What are your ideas for instructions that you've always thought should be handled by the processor, but never seen implemented?
Linus: I actually am not a huge fan of shiny new features. In processor design - as in so much of technology - what matters more is interoperability and compatibility. I realize that this makes people sad, because people are always chasing that cool new feature, but hey, in the end, technology is about doing useful things. And building and extending on top of existing knowledge and infrastructure is how 99% of all improvement gets done.
The occasional big shift and really new thing might get all the attention, but it seldom really is what matters. I like to quote Thomas Edison: "Genius is 1% inspiration, 99% perspiration". And that very much covers CPU architecture too: the inspiration is simply not as important as executing well. Sure, you need some inspiration, but you really don't need all that *much* of it.
So in CPU design, what should really be looked at is how well the CPU is able to do what we expect. The instruction set is important - but it is important mainly as a "I can run the same instructions the previous CPU did, so I can run all your programs without you having to do any extra work" issue - not as a "what new cool feature would you want in an instruction set".
To a CPU architect, I'd tell them to do the best they damn well can in the memory subsystem, for example. Regardless of instruction set, you'll want a great memory subsystem end-to-end. And I don't just mean good caches, but good *everything*. It's a hell of a lot of detail (perspiration), and I guarantee you that it will take a large team of people many generations to do really well on it. There is no simple silver bullet with a cool new instruction that will solve it for you.
And don't get me wrong - it's not *all* about the memory subsystem. It's about all the other details too.
Now, when it comes to actual instructions, I do tend to think that the world has shifted away from RISC. I'm a big believer in being good at running existing binaries across many different micro-architectures - the whole "compatibility" thing. And as a result, I think fragile architectures that depend on static instruction scheduling or run in-order are simply insane. If your CPU requires instruction scheduling for one particular set of instruction latencies or decoder limitations, your CPU is bad. I detested Itanium, for this reason - exposing the microarchitecture in the instruction set is just insane.
No, I want out-of-order and "high-level" instructions that actually work across different implementations of the same ISA, and across different classes of hardware (iow, span the whole "low-power embedded" to "high-end server" CPU range). So for example, I think having a "memcpy" or "memset" instruction is a great idea, if it allows you to have something that works optimally for different memory subsystems and microarchitectures.
As an example of what *not* to do, is to expose direct cacheline access with some idiotic "DCBZ" instruction that clears them - because that will then make the software have to care about the size of the cacheline etc. Same goes for things like "nontemporal accesses" that bypass the L1 cache - how do you know when to use those in software when different CPU's have different cache subsystems? Software just shouldn't care. Software wants to clear memory, not aligned cachelines, and software does *not* want to have to worry about how to do that most efficiently on some particular new machine with a particular cache size and memory subsystem.
What would you have done differently?
by Rob Kaper
It's been over twenty years since the inception of Linux. With 20/20 hindsight, what you have done differently if you had had today's knowledge and experience back in the early days?
Linus: I get asked this quite often, and I really don't see how I could possibly have done anything better. And I'm not claiming some kind of great forethought - it's just that with 20:20 hindsight, I really did choose the right big things. I still love the GPLv2, and absolutely think that making Linux open source was the greatest thing ever.
Have I made mistakes? Sure. But on the whole, I think Linux has done incredibly well, and I've made the right decisions around it (and the big things have *occasionally* been about technical issues, but more often about non-technical things like "Don't work for a commercial Linux company even if it seems like such a natural thing to do - keep working in a neutral place so that people can continue to work with me")
Monolithic vs. Micro-kernel architecture
by NoNeeeed
Has there ever been a time in the development of the Linux Kernel where you've wished you'd gone the Hurd-style micro-kernel route espoused by the like of Tannenbaum, or do you feel that from an architectural standpoint Linux has benefited from having a monolithic design?
Linux has been massively more successful than Hurd, but I wonder how much of that is down to intrinsic technical superiority of its approach, and how much to the lack of a central driving force supported by a community of committed developers? It always seemed like the Hurd model should have allowed more people to be involved, but that has never seemed to be the case.
Linus: I think microkernels are stupid. They push the problem space into *communication*, which is actually a much bigger and fundamental problem than the small problem they are purporting to fix. They also lead to horrible extra complexity as you then have to fight the microkernel model, and make up new ways to avoid the extra communication latencies etc. Hurd is a great example of this kind of suckiness, where people made up whole new memory mapping models just because the normal "just make a quick system call within the same context" model had been broken by the microkernel model.
Btw, it's not just microkernels. Any time you have "one overriding idea", and push your idea as a superior ideology, you're going to be wrong. Microkernels had one such ideology, there have been others. It's all BS. The fact is, reality is complicated, and not amenable to the "one large idea" model of problem solving. The only way that problems get solved in real life is with a lot of hard work on getting the details right. Not by some over-arching ideology that somehow magically makes things work.
Avoiding the Unix Wars
by dkleinsc
Why do you think Linux has been able to (mostly) avoid the fragmentation that plagued the competing Unixes of the 1980's? What would you say helps keep Linux a unified project rather than more forked system like BSD?
Linus: So I'm a huge believer in the GPLv2, and I really do believe the license matters. And what - to me - is important for an open-source license is not whether you can fork (which the BSD's allow), but whether the license encourages merging things back.
And btw, before people go all "license flamewar" on me, I would like to really emphasize the "to me" part. Licensing is a personal choice, and there is no "wrong" choice. For projects *I* care about, and that I started and can make the licensing decision for, I think the GPLv2 is the right thing to do for various reasons. But that does *not* mean that if somebody else makes another choice for his or her code, that wouldn't be the right choice for *that* person.
For example, I'd use a BSD-like license for code that I simply didn't care about, and wanted to just "push out there in case somebody else wants to use it". And I don't think proprietary licenses are evil either. It's all fine, it's up to the original author to decide what direction you want to do in.
Anyway, to just get back to the question - I really do think that encouraging merging is the most important part for a license for me. And having a license like the GPLv2 that basically *requires* everybody to have the right to merge back useful code is a great thing, and avoids the worry of forking.
And I do want to say that it's not that forking is bad. Forking is absolutely *required*, because easy forking is how development gets done. In fact, one of the design principles behind git was to make forking easy, and not have any technical barrier (like a "more central repository") that held back forking. Forking is important, and forking needs to happen any time there is a developer who thinks that they can do a better job in some area. Go wild, fork the project, and prove your point. Show everybody that you can make improvements.
But forking becomes a problem if there is no good way to merge things back. And in Linux, it's not been just about the license.Sure, the license means that legally we can always merge back the forks if they prove to be good forks. But we have also had a culture of encouraging forking and making forking be something that isn't acrimonious. Basically *all* the Linux distributions have had their own "forks" of the kernel, and it's not been seen as something bad, it's been seen as something natural and *good*. Which means that now the fork is all amicable and friendly, and there are not only no legal issues with merging it back into mainline, but there are also generally no big personality clashes or bad feelings about it either.
So it's not that Linux doesn't fork, it's that we've tried to make forks small and painless, and tried to be good about merging things back. Sure, there are disagreements, but they get resolved. Look at the Android work, for example: yeah, it wasn't all happy people and no problems, and it took a while, but most of it got merged back, and without excessively bad feelings, I think.
GIT
by vlm
If you had to do GIT over again, what, if anything, would you change?VERY closely related question, do you like the git-flow project and would you think about pulling that into mainline or not?
Linus: So there's been a few small details that I think we could have done better, but on the whole I'm *very* happy with git. I think the core design is very solid, and we have almost zero redundant information, and the core model is really built around a few solid concepts that make a lot of sense. Git is very unix-like in that it has a few basic design things ("everything is an object" with a few basic relationships between the different objects in the git database) and then a lot of utility is built up around that whole thing.
So I'm very proud of git. I think I did a great design, and then others (and Junio Hamano in particular) have taken that great design and really run with it. Sure, it wasn't all that pleasant to use for outsiders early on, and it can still be very strange if you come from some traditional SCM, but it really has made my life *so* much better, and I really think it got the fundamentals right, in ways that SCM's that came before did not.
As to git-flow, I want to really re-iterate how great Junio Hamano has been as a git maintainer, and I haven't had to worry about git development for the last five years or so. Junio has been an exemplary maintainer, and shown great taste. And because I don't need to, I haven't even followed some of the projects around git, like git-flow. It's not what I need for *my* git workflow, but if it helps people maintain a good topic-branch model with git, then all the more power to them. And whether it should go into mainline git or not, I won't even comment on, because I absolutely trust that Junio will make the right decision.
Storage advancements in the kernel?
by ScuttleMonkey
Now that Ceph is gathering momentum since having been included in the mainline kernel, what other storage (or low level) advancements do you see on the horizon? (full disclosure: I work for Inktank now, the consulting/services company that employs most of the core Ceph engineers)
Linus: I'm not actually all that much of a storage guy, and while I'm the top-level kernel maintainer, this is likely a question that would be better asked of a number of other people.
The one (personal) thing storage-related that I'd like to re-iterate is that I think that rotating storage is going the way of the dodo (or the tape). "How do I hate thee, let me count the ways". The latencies of rotational storage are horrendous, and I personally refuse to use a machine that has those nasty platters of spinning rust in them.
Sure, maybe those rotating platters are ok in some NAS box that you keep your big media files on (or in that cloud storage cluster you use, and where the network latencies make the disk latencies be secondary), but in an actual computer? Ugh. "Get thee behind me, Satan".
That didn't answer the question you really asked, but I really don't tend to get all that excited about storage in general.
favorite hack
by vlm
I asked a bunch of hard architecture questions, now for a softball Q. Your favorite hack WRT kernel internals and kernel programming in general. drivers, innards, I don't care which. The kind of thing where you took a look at the code and go 'holy cow that's cool' or whatever. You define favorite, hack, and kernel. Just wanting to kick back and hear a story about cool code.
Linus: Hmm. You do realize that I don't get all that close to the code any more? I spend my time not coding, but reading emails, and merging stuff others wrote. And when I *do* get involved with the code, it's not because it's "cool", it's because it broke, and you'll find me cursing the people who wrote it, and questioning their parentage and that of their pets.
So I very seldom get involved in the really cool code any more, I'm afraid. I end up being involved in the "Holy sh*t, how did we ever merge that cr*p" code. Perhaps not as much as Greg (who has to deal with the staging tree), but then Greg is "special".
That said, we do have lots of pretty cool code in the kernel. I'm particularly proud of our filename lookup cache, but hey, I'm biased. That code is *not* for the weak of heart, though, because the whole lockless lookup (with fallbacks to more traditional locked code) is hairy and subtle, and mortals are not supposed to really look at it. It's been tweaked to some pretty extreme degrees, because it ends up being involved any time you look up a filename. I still remember how happy I was to merge the new lockless RCU filename lookup code last year.
At the opposite end of the spectrum, I actually wish more people understood the really core low-level kind of coding. Not big, complex stuff like the lockless name lookup, but simply good use of pointers-to-pointers etc. For example, I've seen too many people who delete a singly-linked list entry by keeping track of the "prev" entry, and then to delete the entry, doing something like
if (prev)
prev->next = entry->next;
else
list_head = entry->next;
and whenever I see code like that, I just go "This person doesn't understand pointers". And it's sadly quite common.
People who understand pointers just use a "pointer to the entry pointer", and initialize that with the address of the list_head. And then as they traverse the list, they can remove the entry without using any conditionals, by just doing a "*pp = entry->next".
So there's lots of pride in doing the small details right. It may not be big and important code, but I do like seeing code where people really thought about the details, and clearly also were thinking about the compiler being able to generate efficient code (rather than hoping that the compiler is so smart that it can make efficient code *despite* the state of the original source code).
Books, Books, Books
by eldavojohn
As a software developer, I have a coveted collection of books. A few of said tomes -- both fiction and non -- have fundamentally altered the course of my life. Assuming yours aren't just man pages and .txt files, what are they?
Linus: I read a fair amount, but I have to admit that for me reading tends to be about escapism, and books to me are mostly forgettable. I can't really think of a single case of a book that struck me as life-changing, the way some people apparently find some book that really changed the way they think.
That said, I'll point to a couple of books I really enjoyed. On the non-fiction side, Richard Dawkin's "The Selfish Gene" was one book that I think is pretty influential. On the fiction side, as a teenager I enjoyed Heinlein's "Stranger in a strange land" a lot, and I have to admit to "Lord of the Rings" having been pretty important to me - but for a slightly odd reason, not as a huge Tolkien fan. For me, it was one of the first "real" books I read in English, and I started with a dictionary by my side, and ended it reading without needing one.
These days, I still read crap. I like my Kindle, and often read the self-published stuff for 99c. There are some real stinkers in there, but there's been a lot of "that was certainly worth the 99c" stuff too. I've also enjoyed just re-reading some of the classics I grew up with - I just re-read both the Count of Monte Cristo and the Three Musketeers, for example.
How do you deal with burn-out?
by kallisti5
You must of been burned out on Linux kernel development multiple-times over by now... how do you deal with it?
Linus: Oh, I really enjoy what I do. And I actually enjoy arguing too, and while I may swear a lot and appear like a grumpy angry old man at times, I am also pretty good at just letting things go. So I can be very passionate about some things, but at the same time I don't tend to really hold on to some particular issue for too long, and I think that helps avoid burn-out.
Obsessing about things is important, and things really do matter, but if you can't let go of them, you'll end up crazy.
So to me, some of the occasional flame-wars are really just invigorating. And the technology and the use cases end up changing enough that things never get *boring*, so I actually have not been close to burning out very often.
The one really painful time was some time during the middle of the 2.4.x series (about ten years ago), before I got to hand it over to stable maintenance, and we really had a lot of problems going on. You can google for "Linus doesn't scale" and various other threads about the problems we had back then, and it really was pretty painful. The kernel was growing and I wasn't keeping up, and BitKeeper and some fairly painful process changes really ended up helping a lot.
Describe your computer
by twistedcubic
Can you describe in detail your home and work computers, including processor, motherboard, and graphics card? And also say something about their compatibility with Linux?
Linus: My home computer isn't actually all that interesting: I don't need all that much CPU power any more, and for the last several years, my primary requirement (since CPU's are fast enough) has been that the system be really really quiet, and that it has a good SSD in it. If our cat deigns to jump into my lap while I'm working, the loudest noise in the room should be the purring of the cat, not the computer.
So my main desktop is actually a 4-core Westmere machine, not really anything special. The most unusual part of the machine is probably just the fact that it has a good case (I forget the exact case name now) which avoids rattling etc. And one of the bigger Intel SSD's. I think I'll be upgrading some time this fall, but I will have had that machine for two years now, I think.
My laptop (that I'm writing this with, since I'm traveling in Japan and Korea right now) is an 11" Apple Macbook Air from last year (but running Linux, of course - no OS X anywhere), because I really hate big laptops. I can't understand people who lug around 15" (or 17"!) monsters. The right weight for a laptop is 1kg, no more.
Re:The End
by Narnie
Speaking of ends, one day you'll pass on your duties. How do you envision the kernel and the Linux ecosystem after passing your reigns?
Linus: Oh, the kernel really has a very solid development community, I wouldn't worry about it. We've got several "top lieutenants" that could take over, and I'd worry much more about many other open-source projects that don't have nearly the same kind of big development community that the kernel does.
That said, I've been doing this for over twenty years now, and I don't really see myself stopping. I still do like what I'm doing, and I'd just be bored out of my gourd without the kernel to hack on.
all in all... (Score:5, Insightful)
...someone I could sit down over a pint with and just geek out. Cool.
Re:all in all... (Score:5, Funny)
They use liters in Finland, you insensitive clod!
Re:all in all... (Score:4, Informative)
OK.
Otan 560 mililitres olutta ja paketti perunalastuja
Thanks, Bing Translate. :)
Re: (Score:2)
tha's no good to me if I'm trying to order a pint and some flakeys in Helsinki! :x
Re: (Score:2)
All good :) Props to the Finnish education system, but I figure it's polite to at least make an attempt to learn the language of the country you're going to (even if you do end up murdering tenses, etc). For me, there's very little worse for my mood than trying to give a German tourist directions around Nottingham when he only wants to speak German. My response when I encounter such ignorami is to point at their map and wave with the other hand in the universal greeting "If you can't be arsed to make an eff
Re: (Score:2, Funny)
Don't mention the - oh, never mind.
Re: (Score:2)
Indeed, that probably goes for everyone here. Linus sounds like a cool guy. I especially agree with "I really hate big laptops. I can't understand people who lug around 15" (or 17"!) monsters. The right weight for a laptop is 1kg, no more." Mine is about the size of a hard cover book, and weighs about he same.
I wonder what distro Linux uses? If he uses a GUI or a CLI? If GUI (which I doubt), which one?
Re: (Score:3)
Why do you doubt he uses a GUI? There's been many slashdot stories about Linus's dislike for GNOME (esp. 3).
Re:all in all... (Score:5, Informative)
Last I heard he uses Fedora and XFCE4 after leaving the sinking ship that is GNOME 3. (Choice quote: "Who do I need to fuck to get standard font size and panel options, instead of having to wade through this kind of "unsupported and random extensions that look ugly as hell and break randomly" crap?")
Re:all in all... (Score:4, Informative)
Indeed, that probably goes for everyone here. Linus sounds like a cool guy. I especially agree with "I really hate big laptops. I can't understand people who lug around 15" (or 17"!) monsters. The right weight for a laptop is 1kg, no more." Mine is about the size of a hard cover book, and weighs about he same.
Depends on what you do with it. My "15-inch monster" isn't too bad - it's a Retina MBP, so it's relatively light and thin - and I use it as my primary machine, so I want a bit more "disk" space and screen space. I mainly move it around the house, so it's good that it's portable, but it doesn't have to be as portable as a road warrior's machine.
I wonder what distro Linux uses?
Well, at least earlier in 2012, part of the answer was "not OpenSUSE" [google.com], at least on the laptop. He's apparently used Fedora in the past [ostatic.com], at least; he probably doesn't use any of the Real Man's Linux Distributions, given that, at least back in 2007, he said "Funnily enough, the only distributions I tend to refuse to touch are the "technical" ones, so I've never run Debian, because as far as I'm concerned, the whole and only point of a distribution is to make it easy to install (so that I can then get to the part I care about, namely the kernel), so Debian or one of the "compile everything by hand" ones simply weren't interesting to me." [apcmag.com]
If he uses a GUI or a CLI? If GUI (which I doubt), which one?
Prepare to have your doubts busted; at least as of whenever he made the announcement (I'm not going to sign into my Google account just to read his posting, but the article in question is from April 2011) [linuxjournal.com], he was using Xfce, after switching from KDE 4 to GNOME 2.
Of course, "GUI or CLI" is a bit ill-stated. I "use a GUI" in the sense that I don't do a console login on my Mac and run on the console tty, but a lot of what I do is in a GUI app called "Terminal", so I'm using a CLI in a GUI. In the 2007 interview [apcmag.com] in answer to "What software do you use everyday? Your browser, desktop (if any), email client and so on?" he said "Well, ignoring the actual development stuff (make, compiler, editor etc), it ends up being mostly just xterms and "alpine" (the newer version of the venerable old "pine" email reader. Strictly text-based, thank you very much)." In the next paragraph he also included a browser, but it sounds as if it's in the "a lot is a CLI in a GUI" category.
Re: (Score:3)
According to what I can find, as of 2011, he was running Linux Mint with XFCE.
Re: (Score:2)
I guess that means you don;t think of yourself in this category: "Quite frankly, there are a lot of f*cking morons on the internet."... unfortunately, it depends on what category Linus thinks you're in... I wouldn't hold out much hope if you choose the wrong sort of pint!
Re: (Score:2)
Local dark ale, every time.
Re: (Score:2)
A buddy of mine (a Brit) recently confessed to me in embarassment, that in fact, the most popular beer in Britain is now Budweiser.
Take that for what it's worth -- I don't know if it's true.
Re: (Score:2)
f*cking morons (Score:5, Funny)
Good to see Linus keeps up with his traditions in the first answer already by calling certain people morons. :-)
Not So Fast On The Pointers (Score:4, Interesting)
simply good use of pointers-to-pointers etc. For example, I've seen too many people who delete a singly-linked list entry by keeping track of the "prev" entry, and then to delete the entry, doing something like
if (prev)
prev->next = entry->next;
else
list_head = entry->next;
and whenever I see code like that, I just go "This person doesn't understand pointers". And it's sadly quite common.
People who understand pointers just use a "pointer to the entry pointer", and initialize that with the address of the list_head. And then as they traverse the list, they can remove the entry without using any conditionals, by just doing a "*pp = entry->next".
I'm going to have to disgree with Linus on that one. When I'm coding in a mixed group of people that includes old farts and interns and the performance isn't that critical, I'll do the former over the latter to insure that everyone in the group will understand it easily and will have less chance of breaking it if they change it. It can mean the difference between code that is robust and code that is fragile when it's being worked on, not just when it's running.
Re:Not So Fast On The Pointers (Score:5, Interesting)
I believe that his pointer example is more a matter of personal style. I can easily see how doing away with the conditions will make for more efficient code, but in many cases, the preference he cites might also make the code a little more obfuscated. However, even that's nothing that a single-line comment wouldn't fix, making sure that whoever is reading the code fully realizes the intent behind it. I think perfectly valid arguments can be made for doing it either way.
Personally, I would classify this as a type of pointer design pattern that is ideal with linked list data structures, but I would not suggest that a person who doesn't regularly use every clever design pattern for pointers at every opportunity is necessarily less knowledgeable than one who does. In many cases, in fact, a person in the latter category may even be arguably guilty of simply trying to show off, rather than actually get whatever needed doing done.
Re: (Score:2)
With the work I do I am able to favour readability over efficiency (then optimize if required.. no premature optimization). It makes maintenance so much easier (and let's face it, code spends most of its life being maintained). Code is already way harder to read than write a
Re:Not So Fast On The Pointers (Score:4, Insightful)
Processors and memory are cheap, a developer's time isn't.
And that attitude in application developers is the reason my 1 GB RAM, dual core laptop runs like sludge.
We've bought a few externally supplied programmes at my company recently, all promising to be within our minimum requirements for hardware. But try to run even a handful of them at once and the whole thing crawls to a halt. The developers on each of them were undoubtedly saying "processors and RAM is cheap, we don't need to optimise!". Bastards the lot of them.
Re: (Score:2)
Sorry, but I think Linus is right here.
I never said Linus was wrong. In fact I was agreeing it is correct in the kernel. A kernel dev would have no problem reading and understanding his example. Your average joe coder might stumble over it.
This is simply a smaller-scale of the same kind of improvement that object-oriented is.
What? That doesn't make any sense in the context of replying to my comment.
Re: (Score:2)
Average Joe coder must be educated, not kept in the darkness.
No. Not really.
Not all developers need to be able to read advanced pointer usage and tricks for the sake of tricks is stupid. There must be a measurable performance difference or it has to be easily readable by the group developing. If it isn't easily readable and there is no performance justification then education isn't the issue, it's developer ego, "Well I can read it."
Yeah, good for you. But I don't care about that. I care about whoever ends up having to maintain your difficult to read code. Prematu
Key issue in kernels, atomicity (Score:2)
I think perhaps the point that he was making about designing with pointers wasn't fully appreciated by everyone, because he didn't really spell it out. It's not just a matter of preferred coding style nor clarity, far from it.
The unconditional pointer update approach is atomic by virtue of the update being performed in a single memory write cycle, whereas the longer conditional form is clearly not atomic, and to make it atomic would require using locks. (There's a bit more to it than that because you st
Re: (Score:3)
I've been programming in C for nearly 30 years... when I saw his counter-example, I still had to pause for just a second to think about it. Yes, I see what he did, and I've even used that pattern myself in software that I've written. There are quite legitimate reasons to use that form that are applicable to system programming, so I don't object to it over the conditional form (I actually even prefer it, in many cases), but a simple one-line comment which clarifies the intent would definitely be preferre
Great Read (Score:5, Informative)
Re: (Score:3)
Yeah, it was very interesting. Though I sort of disagree about the non-temporal access part. Sure exposing the details of your cache hierarchy is stupid when that hierarchy can change. But telling the processor "I don't intend to access this data again" is actually a very useful hint for a lot of microarchitectures, and the ones that don't benefit can just ignore it (and even the cache-hierarchy specific ones can be either ignored or altered to suit a design -- none of them *promise* that data will be co
NAS hater (Score:2)
Hey Linus, guess what's my favorite kernel to run on that NAS computer? Yours. And yes, it is an "actual computer." Sorry if it's not sexy enough for ya.
Re:NAS hater (Score:5, Funny)
Yeah, the chicks are all into low-latency/high-throughput. They want to watch their 20 gigabyte movie files in 12 seconds (with the first NFS reply coming less than 5ms after the request) and my computer can't serve it that fast! So they all go over to Linus' house, with his flashy SSDs and .. oooh, it makes me so mad.
Re: (Score:2)
Is it bad when reading this gave me an idea of caching the first $X meg of each file on a NAS in memory or SSD so serving would start quickly while the disk caught up and fed the rest?
One overriding idea (Score:5, Insightful)
I found this part insightful beyond technology:
If you have "one overriding idea," you've made that idea the part of your thinking that serves as your reality-check, not reality itself as your reality-check. Great point, Linus, and one that I constantly encounter in completely non-tech-related fields.
Re: (Score:2)
If you have "one overriding idea,"
Like "everything is an object" in Git?
Re: (Score:2)
I was just quoting Linus.
Re: (Score:3)
Couldn't agree more. That was my question, and the answer was better than I could have hoped for.
It's interesting, and probably not that surprising, that those people who actually accomplish stuff rarely seem to be zealots about how they get them done.
I currently do Rails development (after doing everything from embedded systems to Pel hackery), and that community seems to be particularly full of people with a religious fanaticism to certain principles, either methodological or design-pattern wise. The cur
Re:One overriding idea (Score:4, Informative)
No, that was the big genius idea behind Plan 9. UNIX saw that, took the ideas that worked (like procfs) and used them, but skipped the less useful ideas (doesn't Plan 9 have a pseudo-file for each window?).
The overarching idea behind UNIX is "whatever". Name any "big genius idea behind UNIX" and I'll point to a dozen counterexamples.
Re: (Score:2)
Name any "big genius idea behind UNIX" and I'll point to a dozen counterexamples.
Part of "The UNIX Way" is to have counterexamples when the alternative would be too contrived :)
Good quote (Score:5, Insightful)
This bit by Linus is easily one of the best and most concise quotes about problem-solving that I've read. Any sot of 'manifesto' about programming or engineering in general that does not have a caveat along these lines as one of its tenets is extremely flawed.
"The fact is, reality is complicated, and not amenable to the "one large idea" model of problem solving. The only way that problems get solved in real life is with a lot of hard work on getting the details right. Not by some over-arching ideology that somehow magically makes things work."
Re: (Score:2)
I've said similar things when people talk about grand plans for projects, and yet, somehow, their plans never come out right because they're more interested in the procedure than if the work is getting done.
If I happen to get an interview for a job I recently applied for, I will try to work that quote, or part of it, into an answer or two. It's the head of a small department dealing with projects, so it should be easy.
Re: (Score:2)
Re: (Score:2)
Yeah. The caveat to the caveat is that some real-world problems have known optimal solutions (i.e. there's mathematical proof that the solution is optimal), or have a best known heuristic that you would be an idiot not to use unless you've discovered a superior heuristic.
BWaaahahahahahaahaaha (Score:5, Funny)
"Greg is "special""
Glad there's a team (Score:2)
So many of the answers took the form, "that use doesn't fit my personal needs, so people who have those needs are crazy/uncool/idiots." It's very good that Linux is now in a position to ensure quality code, not decide on what code will be included.
He also needs to do a bit more refactoring on
if he thinks there's a non-fragile way to implement such a system. Or, even better, do a git and find the p
Decent little chit-chat (Score:2)
So there's been a few small details that I think we could have done better, but on the whole I'm *very* happy with git. I think the core design is very solid, and we have almost zero redundant information, and the core model is really built around a few solid concepts that make a lot of sense.
I had hoped to see that answered with "I wish I had started git as libgit+git from the get-go, instead of the hacky shell-script semi-architecture it started with" - but that's (obviously) because I value portability and embeddability in other projects.
Also, while I appreciate Linus' outspoken no-bullshit personality, I find that sometimes it devolves into cursing and rudeness - this is one of the occasions where he's entirely mellow, lucid and reasonable, and that's nice to see :-)
His other child (Score:3)
That said, I've been doing this for over twenty years now, and I don't really see myself stopping. I still do like what I'm doing, and I'd just be bored out of my gourd without the kernel to hack on.
And this is why he changed the world. Doing what he loves, even if Linux is not his favorite child.
edison and perspiration — cut the cruft (Score:3)
to quote nikola Tesla — "If Edison had a needle to find in a haystack,
he would proceed at once with the diligence of the bee to examine
straw after straw until he found the object of his search.
I was a sorry witness of such doings, knowing that a little theory
and calculation would have saved him ninety per cent of his labour.
(Nikola Tesla, New York Times, October 19, 1931)
likewise msr torvalds — you advocate stable processors — elegance be damned.
true enough, stability is paramount for reliability — but it is also important to
not preserve a perverse or arcane standard.
knowing what features to consolidate and prune can save a great deal of useless
backwards compatibility work, and save labour down the road.
two examples: i) we could do well to learn from the feat of the late s.jobs — where he
was able to poll the developers about what APIs they were actually using — and
prune out a bunch of dead CRUFT, and leave a core set of stable APIs (the now
defunct CARBON) that would bridge developers — by tweaking a little code,
they could gain the benefit of the new OSX architecture, while maintaining
backwards compatibility. ii) the move from parallel printer, and PS2 style
keyboard and mouse vs the move to USB — it was wise to eliminate multiple
incompatible standards which were being used in wrong ways (parallel printer
ports being used for ZIP drives!?!?) — total USB and elimination of legacy ports
was a good call.
instead of MONOLITHIC & CRUFTY — lean and well-defined.
please.
2cents from toronto island
jp
Re: (Score:2)
Re:Buffing? (Score:5, Funny)
True, it's a proper name, not a common word, but I've always liked this:
In Sparkill buried lies that man of mark
Who brought the Obelisk to Central Park,
Redoubtable Commander H.H. Gorringe,
Whose name supplies the long-sought rhyme for “orange.”
-- Arthur Guiterman
Re: (Score:2)
Ummm, what about Syringe? I'm pretty sure that rhymes with orange.
Only if you cheat by putting the em-FAH-sis on the wrong syll-AH-ble.
In that case, I have to say that my favourite solution to the orange rhyming problem is Tom Lehrer's (even though it too, is a cheat).
Eating an orange
While making love
Makes for bizarre enj-
-oyment thereof
Re:Buffing? (Score:5, Interesting)
Re: (Score:2)
Let me guess, you are a George Hrab fan.
One Saturday Morning (Score:2)
Re: (Score:2, Interesting)
Dialects and accents differ, but lots of people pronounce the "h" (with a brief hesitation in front of it) in "door-hinge", and also enunciate the "i" (rather than the schwa in "orange"). So, no... they don't.
Re: (Score:3)
Well, as long as you invent a definition of "rhyming" that allows what you want it to allow... and as long as you ignore the fact that vowels don't necessarily match either... and you assume that your local accent is how "most people" pronounce them... sure, they "rhyme".
Re:boring (Score:5, Insightful)
tl;dr
Speak for yourself, I enjoyed reading it.
Re:boring (Score:5, Interesting)
Same here. Awesome read. Refreshing to see such a high-profile geek who doesn't feel the need to douche it up in interviews.
Re: (Score:2)
As someone who has read a lot of his interviews there wasn't anything really new or unexpected in these questions/answers.
But hey if that makes Linus predictable that could be good for Linux development, right ? ;-)
Re: (Score:2)
I should correct myself, I did realize something from reading his answers.
Torvalds wants the same thing from licensing as he wants from his version control system for his projects: easy forking and especially easy merging.
Re:boring (Score:5, Interesting)
Re:boring (Score:5, Insightful)
He's rightly satisfied with his efforts, that's not being a douche.
Re: (Score:2)
Well, that's how you read it, but I interpret it as something different: Linus has become so "wise" (I really think that's the correct word but I could be wrong!) in managing large-scale projects, that he sees that
Re: (Score:2)
So you're uncritical in your analysis of his response that you clearly didn't really read, and that makes Linus a douche. Got it.
Re:boring (Score:5, Insightful)
Look, there's a bunch of stuff in this interview that I disagree with. That's okay; it takes all sorts.
But here's the thing: Linus has earned the right to be a douche.
We are long past the point of hagiography when it comes to Linus. In the early 90s, we all though it was cool that a young, rebellious upstart took on (in retrospect, argued cross-purposes with) the likes of Andrew Tanenbaum. Today, he's middle aged and getting crotchety, and now we just smile, shake our heads and remind ourselves that Linus is Linus. We love him dearly, even if we have to take him with a grain of salt.
Everything he says is a mix of hard-won experience with just the right amount of over-opinionated patent nonsense. But even the over-opinionated patent nonsense is interesting, and I don't mean in the apocryphal Chinese curse sense. It serves our purpose that Linus speaks his mind without restraint, because his signal-to-noise ratio is high enough that getting through the crap to obtain the good stuff is a tractable and even enjoyable endeavour.
Yeah, he can get self-important and myopic at times. So can you, and so can I. You and I haven't won the right by conquest to blurt it to the world.
Actually, playing armchair psychologist for a moment (hey, this is Slashdot), maybe this is actually jealousy. Maybe you're calling Linus a douche because you wish you could be a douche and people would still listen to you.
Re: (Score:2)
Seconded (or thirded by this point maybe?) - I really enjoyed that.
Re:boring (Score:4, Funny)
Ditto.
One series of questions I didn't see asked:
Linus, /. account? Do you lurk or read regularly? Are you an Anonymous Coward?
Do you have a
And, by the way: My most heartfelt thanks to you for everything you've done for the common good.
Re: (Score:2)
If you didn't read it, how would you know it's boring?
Re: (Score:3, Informative)
I'm an atheist, I don't read Dawkins. My wife is an atheist, she doesn't read Dawkins. Just because someone is an atheist doesn't mean they're knee deep in the pro-atheism community. You make atheism sound more like a religion than what it actually is...
Re: (Score:2)
Yeah. I've never read anything by Dawkins.
Oh, what's that you say? There's no such thing as magic and evolution is be best-supported theory in all of science? Yeah, I already knew that.
Then again, his books are on the long list of books I might read some day. I don't reject them, I simply don't seek them out.
Re:sadly funny (Score:4, Insightful)
You make atheism sound more like a religion than what it actually is...
Sadly a lot of atheists give that impression in their actions.
Isn't that an observational fallacy? I'd imaging you'd have a hard time identifying non-evangelical atheists (or the denomination of most non-evangelicals for that matter).
Re:sadly funny (Score:4, Funny)
It warms my heart when "religion" is used as a pejorative...
Re: (Score:2)
It'd be more accurate to say that magical thinking and a whole raft of cognitive biases seem part and parcel of being human. Obviously affecting us to varying degrees, with no-one is completely free of them.
Exactly how do you arrive at the conclusion that lack of belief *often* becomes a religion in itself? To see the majority of atheists I know, applying the label of religion to their atheism inspired actions and beliefs robs the word religion of any solid meaning. I'd agree that *sometimes* it becomes way
Re: (Score:3, Informative)
What, that like minded people might enjoy getting together and discussing topics of common interest? If that's all it takes to be a religion, hell /. itself qualifies as a religion.
You've effectively made the term "religion" meaningless with that argument. "Are you religious?" "Well I meet a bunch of guys at the local sports bar and discuss the issues of the day, so yes." That's nonsense. One thing and one thing only identifies a religion. Magical thinking.
BTW, there was a lot more disagreement among t
I refute your claims; care to do the same? (Score:5, Insightful)
So, you claim that organized efforts to ensure that religious dogma stays out of science classes, or to find ways to avoid the demonization that atheism receives in many communities and societies around the world, would constitute "ritual and tradition for nothing"? I contest the "ritual", the "tradition", and the "for nothing" in that statement.
Let's start with tradition, as that's probably the easiest for you to claim. Here's the thing: unlike (organized) religions, where one is more-or-less expected to carry out certain actions (go to church, pray toward Mecca, celebrate some holidays, whatever), there is absolutely no expectation that athiests go to athiest conferences. Nor is there a "tradition" of athiests, as a community, even holding such conferences. Pilgrimage is considered a tradition in some religions, even if many people never take one, because it's seen as a thing that "people in that religion do". Aside from in the context of this discussion, though, I've never heard of "go to athiest conferences" as a thing that atheists do (and I've been athiest, or at least agnostic, for over 80% of my life; I knew that I didn't believe in a deity before I knew there was a word for it).
Moving on, consider the claim that it's a "ritual" to hold or attend such concerences. I suspect this is your own unfamiliarity with the thought process of people who reject the very notion of "take it on faith", here. Ritual implies something practiced, something repeated, a sequence of actions that people have learned to do for the sake of the ritual itself. That's not to say that there's anything wrong with the actions of a ritual, just that, if you're trying to build on things, to understand them and improve them, it isn't a ritual at all. With most devout Christians, for example, going to church is a ritual; they may know why they do it, but they don't try to analyze the behavior. For a good preacher, writing and delivering a sermon should be absolutely not a ritual; he or she should be trying to guide people, to convince them of something or dissuade them from an action, to speak to the congregation in terms that they will understand, or at least that they think they understand. That's a matter of thought and creativity and understanding. By contrast, at an athiest conference, those things are expected of everybody. People host conferences because they want to bring others who are interested in a topic together. People attend conferences because they want to talk about, or listen to, what others have to say on a topic. Both the hosts and the attendees have their own ideas to share, their own questions to ask. Nobody is going through rote actions. Everybody has thought about it and made a conscious decision to attend, rather than simply carrying out some practice that is ingrained in them. It's the opposite of a ritual.
Finally, let's consider the claim that these things which a tiny handful of atheists sometimes do, are done "for nothing." It is a simple fact of history that religions tend to be supporessive of radical ideas. The very concept of "heresy" is an impediment to human progress. It is one thing to disprove a hypothesis, or even discredit a publication which makes fraudulent claims. It is quite another to denounce a line of thought purely on the basis of what one was taught. Allowing religious beliefs to be taught in schools, or to guide public policies, acts contrary to the core concept of science, and therefore to human advancement: that ideas (theories, in the common usage) must be testable, demonstrable, and refutable, before they can be accepted as the basis for new theories. What's more, the old theories are never considered to simple facts; they are always open to refutation by alternative theories that explain observations better. The idea that religion, with its dogma and concept of heresy, can guide the lives and actions of people, either in the individual or as a society, is perhaps the greatest single man-made retardant to the advancement of human knowledge. For those who take an active i
Re: (Score:2)
If he'd said "The God Delusion" by Dawkins you might have a point in what you said, but since he was talking about "The Selfish Gene", which doesn't talk about gods or religion at all, but is very illuminating about how life works and why creatures do what they do, the point is just at the top of your cap.
Re: (Score:2)
If he'd said "The God Delusion" by Dawkins you might have a point in what you said, but since he was talking about "The Selfish Gene", which doesn't talk about gods or religion at all, but is very illuminating about how life works and why creatures do what they do, the point is just at the top of your cap.
Yeah, it's still only one book/author. I'd like MOAR references for books he doesn't define as "mostly forgettable".
The real crux is that he said he can't think of any books that really made a difference to his world view:
I read a fair amount, but I have to admit that for me reading tends to be about escapism, and books to me are mostly forgettable
Really, I'm just curious how wide/broadly read he is. No ding on atheism or Dawkins implied. Linus is one really interesting person in current times, and if he's painfully centered on his field then that's relevant.
Re: (Score:2)
It might suprise you to know that not all atheists read Dawkins. We don't need people like Dawkins to tell us what to think. It's all pretty obvious if you read about science and use your own brain. If you just read and parrot Dawkins you're not any better than a Christian parroting the bible.
I did read Bertrand Russel's "Why I am not a Christian", but that's because Russel is awesome. And I read Dennett's "Consciousness Explained" but that's not about atheism. It's entirely possible to be a modern
Re: (Score:2)
The Selfish Gene, like most of Dawkins books, really has jack to do with atheism. If you read it and like it, it probably means you are not a creationist, but that is about it. It is a science book, not a philosophy book.
Re: (Score:2)
Re:Application Bianry Interface (Score:4, Informative)
Huh?
Linux has one of the most stable ABIs ever. You can still run code from nearly twenty years ago (given the proper libc) - the syscall interface is incredibly stable.
What you are probably thinking about are kernel internals. But since when are drivers considered applications!?
Re: (Score:2)
asks about stable ABI...
CPU architectures should support the same instruction sets for 30 years, because backwards compatibility is king, but hardware vendors should expect to jump every time one of the kernel devs feels like making changes.
here we go again with the FUD (Score:5, Informative)
Did you not read the responses to that question?
Linux runs on over two dozen processor architectures. Things that aren't integrated with the kernel don't have a prayer of working on different systems.
But okay, this isn't a huge issue, just the kernel's ability to talk to hardware. People are writing all sorts of drivers for Solaris, Mac OSX, and BSD, because they have stable ABIs. Heck, I like to write one of each a day -- before breakfast, if possible.
A stable ABI is a tradeoff: guaranteed compatibility for the short term, and guaranteed incompatibility for the long term. Eventually the OS vendor will change their driver interfaces, and unless the affected drivers are in the kernel, someone else is going to have to take some extra effort to fix them and distribute their changes.
Also, I'd like to introduce you to the concept of technical debt: [wikipedia.org] The cost of maintaining bad code -- e.g., keeping around an obsolete API/ABI for compatibility's sake -- tends to accrue over time. In the context of the previous paragraph, Microsoft pushes this technical debt off to device manufacturers, with interest.
Lastly, in addition to the technical reasons, Linus likes the non-stable ABI and the GPL because they both force more code to be contributed back to the kernel. That's your soundbite answer. You're probably not going to make headway on this issue.
I leave the floor open to anyone who has tried and failed to get driver code into the kernel: i.e. those with a legitimate complaint.
Re: (Score:3)
Regarding plans...
Your post seems to be a snark saying 'future is the only kind of plan'. If that is the case, I must disagree.
There are 'past' plans, which are normally filed under "promising failures"
There are 'plans now unfolding' or 'present plans' which is also 'stuff currently being worked on' which is generally according to a 'past' plan that escaped the failure file.
And there are 'future' plans, which I agree are the best kind. The first two plans can be learned of from looking at discussion lists
Re:yay, pointers... (Score:5, Insightful)
They're a fundamental part of low-level programming, which is exactly what an operating system is.
For higher-level programming, you're right that you're probably better off with languages that don't need you to explicitly manage them, like Java and Python. But at some point, you have to get to something that deals with the hardware, and you really can't do that without using pointers.
Re: (Score:3)
And your code in the language where you don't explicitly mange them is going to be using them underneath in some places and understanding where those places are is going to result in the code written in that language running much faster.
You shouldn't be doing higher level programming if you don't have a general understanding of the code what you are writing is going to turn into.
Re: (Score:2)
Cartridges.
Programs come installed on RAM bearing cartridges. Need more memory to save your photoshop files? well, you should have bought the Pro version with a larger SSD. Not enough RAM to render your CAD drawing? Too bad you didn't by the Enterprise Extended Edition, it came with 32Gb of RAM and a faster GPU.
Both satiric models you mention have been used (Score:2)
Programs come installed on RAM bearing cartridges. Need more memory to save your photoshop files? well, you should have bought the Pro version with a larger SSD.
Even with the cartridge model as seen on video game consoles, you still need pointers to store more than one document.
Not enough RAM to render your CAD drawing? Too bad you didn't by the Enterprise Extended Edition, it came with 32Gb of RAM and a faster GPU.
Now you're getting into the pre-PS1 arcade model, where each game came on a custom PCB. (Later arcade platforms, such as System 573 or Triforce or Taito Type X, used essentially PC or console hardware.)
Re: (Score:2)
It's a good way to express your mood without personally attacking the audience.
Re: (Score:2)
It's a good way to express your mood without personally attacking the audience.
1. If your audience is going to be offended by calling people "fucking morons" then I would posit that they will also be offended by calling people "f*cking morons".
2. If you have to resort to calling people "fucking" anything then you have undermined your argument by letting your emotions get in the way of the facts.
Re: (Score:2)
In what way does an asterisk avert personal attacks? "Fuck you" and "F*ck you" are exactly the same. If you don't mean "Fuck" you wouldn't say "F*ck".
Re: (Score:2)
Some people have to worry about work. Places of employment sometimes place filters to shield themselves from lawsuits which will look for words and either block the page entirely or flag it for a followup by HR.
A well disciplined public speaker will take that into consideration in their speech. In some cases, someone else would do it for them in something like this where the speech or answers to questions are written. If your communications are in a way that constantly endangers part of your audience, you w
Re: (Score:2)
It's not disingenuous, it's being polite and respectful of your potential audience.
If he really wanted to be polite and respectful to his audience, he would replacing "fucking morons" with "stupid", or do away with the insult entirely and just focus on the argument. Words like "f*ck" are a lame copout.
Re: (Score:3, Informative)
Because he is not a native speaker, and a programmer. Boring, repetitive sentence structures have low thinking-overhead and allow the most efficient processing of the content. Short words that indicate a (small) relation between sentences is more organised than a stream of unconnected sentences. Programmers like well structured data, or else they could only write very short programs before running into too much complexity. Lexical creativity is for people who don't care about handling large amounts of data
Re: (Score:2)
So that he can get his point across.
Begin a sentence with a connective (Score:3)
Re:Parasitic words (Score:4, Informative)
Considering that Linus was born in Finland to a "family [belonging] to the Swedish-speaking minority," (http://en.wikipedia.org/wiki/Linus_Torvalds [wikipedia.org]) IMHO his English is very good and, by comparison to the
Get back to me when you speak three or more languages.
Re: (Score:2)
The worst fucking thing ever to happen to PCs - and I really mean this, the worst thing to ever happen has been the netbook and now the garbage ultrabook cretinous stupidity. These are all either horribly hobbled, or massively over priced piles of steaming garbage.
Not quite true. Microsoft trying to support them is one of the reasons for Windows 7 and Windows 8 being so much faster. There's only one way to increase performance on such low-spec machines, and that's to optimize.
Re: (Score:2)
Well, I disagree with pretty much everything you said, so I feel a need to contradict you.
SSDs are great. They offer them in cheap, short-lifespan versions and less cheap, longer-lifespan versions. And you can back them up to HDDs, which is something they're still good for, besides bulk data.
Thin and light is great, and netbooks are great. They just don't replace more powerful machines. For those people who are literally always on the go, an ultrabook or notebook or desktop replacement laptop may make sense
Re:Right? (Score:5, Informative)
No, he's removing an entry from the list, so *pp = entry->next is correct; point the previous list entry at the entry beyond the one you're removing. What you wrote is for walking the list, which would be in the loop where you find the list entry you want to remove.
Re: (Score:2)
Sorry, I didn't think enough. First part is the same; what he wrote is what he meant. The second part isn't; what you wrote is not really applicable.
The whole function would look like something like this (I'm being bad and ignoring the case where the entry isn't in the list):
list* entry = list_head;
list** pp = list_head;
while(entry != entry_to_delete) {
pp = &entry->next;
entry = entry->next;
}
*pp = entry->next;
At the last step, pp is either pointing to the 'next' m
Re: (Score:2)
That's a good point.
Re: (Score:2)
Except you can't drop entry in the 'find entry to delete' loop and use *pp or you'll be modifying the list itself as you traverse.
Re: (Score:3)
Oh, does someone who actually does something and impacted an entire industry need to be happy and sunshine filled?
DO something.