admin's blog

Why do I keep writing C++?

Submitted by admin on Sat, 03/28/2009 - 9:04am. ::
[From elliotth's blog]

When you think of Unix daemons, you probably think of C or C++. When you think of cobbling together a program from a handful of libraries on Linux, you probably think of all the C and C++ libraries just a dependency away.

This, at least, was how I ended up writing the very first version of mp3d in C++. And it was a huge mistake. Throwing away two days of work and starting again in Java was the best move I made.

Aren't all daemons written in C/C++?

Tradition is a state, not a reason. Just because the daemons we grew up with (or wrote) years ago were in C doesn't imply that C was particularly suited to writing daemons, or that we should use it to write any more.

I think part of the problem here was that I could pretty much see the boilerplate, ready to flow out of my fingers. And that boilerplate was in C++. The opposite would have been the case if I'd been thinking of a GUI application. It wouldn't have even crossed my mind to consider C++ for one minute. The relevant boilerplate would have been ready, and this time it would have been in Java.

In the server case, such "thinking" is short-sighted. If the boilerplate is the hard part of what you're about to do, what you're about to do probably isn't worth doing at all.

But all those great libraries...

I think what really convinced me, though, was the idea that I'd be able to grab one of any number of HTTP libraries and id3v2 tag libraries if I chose C++.

Never mistake quantity for quality.

CNBC homepage reacting to Dow dropping to 7600

Submitted by admin on Fri, 11/21/2008 - 12:06am. ::

Screenshot from CNBC as Dow drops below 7600.

KernelTrap: Killing Tasks On Frozen NFS Mounts

Submitted by admin on Sat, 09/01/2007 - 9:27am. ::
Linux: Killing Tasks On Frozen NFS Mounts -

"I've long hated the non-killability of tasks accessing a dead NFS server," Matthew Wilcox said along with a prototype patch to fix the issue based on a 2002 posting by Linus Torvalds. Matthew added, "I've only added one real user of the killable concept to this patch -- try_lock_page(). However, this is enough for 'cat */*/*' to be killable with a ^C when I unplug the ethernet cord between it and the nfs server."

Linus responded favorably to the patch, "hey, I obviously approve. And the patch looks simple." He went on to suggest that he was interested in merging the patch during the next merge window, "feel free to re-submit after 2.6.23 is out the door, I don't think anybody will really complain. Any NFS user will know why something like this can be really nice."

read more | rsync.net - Offsite Unix Backups

[KernelTrap]

Dave@NetApp: Oracle Optimizes Its Database for NFS

Submitted by admin on Wed, 08/22/2007 - 9:55am. ::
Oracle Optimizes Its Database for NFS -

NFS has become critical to data center grid environments. As a result, Oracle has optimized its code specifically for NFS. Instead of relying on the operating system, Oracle’s Direct NFS Client generates NFS requests directly from the database.

Direct NFS was inspired by experience at Oracle’s Austin Data Center. Oracle uses NFS to run its applications on tens of thousands of Linux servers accessing many petabytes of NetApp storage. In 2005 they had 12,000 Linux servers and 3 petabytes of NetApp storage. Today’s numbers aren’t public, but they are much larger.

When an operating system capability becomes sufficiently important, Oracle pulls it into the database. Memory management became critical, so Oracle said, “Just give me the raw pages, and I’ll manage them myself.” Disk caching became critical, and Oracle said, “Just give me the raw disk blocks, and I’ll cache them myself.” Now NFS has become critical, so Oracle says, “Just give me a raw TCP/IP socket, and I’ll generate NFS requests myself.” 

Steve Kleiman has argued that as Oracle becomes more sophisticated, the operating system becomes little more than a device driver framework that gives the database raw access to the hardware. That sheds new light on Oracle’s Unbreakable Linux program.

Dave@NetApp: Green Data Centers and Solar Villages (Change is Most Likely When Heart and Wallet Align)

Submitted by admin on Mon, 07/30/2007 - 3:44am. ::
Green Data Centers and Solar Villages (Change is Most Likely When Heart and Wallet Align) -

The Solar Electric Light Fund (SELF) provides solar lights to poor villages in developing countries. The trouble with solar is that it doesn’t work at night. (D’oh!). Off-grid solar is impractical for most first world houses because it takes expensive batteries to run 100-watt light bulbs and big TVs. When the competition is a dim and smoky kerosene lamp, small/cheap batteries work just fine. The payback is surprisingly fast; villagers already pay $5-10 a month for kerosene. The unexpected result is that solar power today is economically feasible for poor rural villages, but not for first world homes. Just as some developing countries have gone straight to cell phones, skipping landlines, rural villages may skip the power-grid and go straight to solar.

Syndicate content