The Register® — Biting the hand that feeds IT

Feeds

Sun may or may not be about to obliterate Oracle and Microsoft

Transactional memory: The great nerd equalizer

SaaS data loss: The problem you didn’t know you had

Fail and You I don’t know about you, but every time I have to program with threads and shared resources, I want to remove my face incrementally with a salad fork. Locks, mutexes, the synchronized keyword; all of these things can strike fear into the heart of a green developer. Most seasoned developers just fall into a rut of depression when it’s time for multi-threading. Developers like me simply talk our way out of it. It’s easier than thinking.

That might all change soon.

It’s very possible that Sun Microsystems has their shit together as they engineer the new Rock processor. Due out in 2009, it will be the first mainstream CPU to support transactional memory. Transactional memory will not only solve all your horrid threading problems, it will also impregnate your daughter if you don’t keep an eye on it. Don’t say I didn’t warn you, gramps.

Homework Is Hard. Let’s Play Video Games

Now I don’t know how you did it, but when I was in computer science class and the topic of threads and mutexes came up, I gave it a whole hearted fuck this and took a 45-minute bathroom break. In the typical American fashion, I expected somebody to bail my ass out when I had to do this in industry. And, if Sun’s transactional memory works, then all the suckers who stayed in class learned resource locking for nothing. Who’s smart now?

What I would have learned had I been more dedicated to my education were the two fundamental facts about multi-threading with locks:

  1. You’re going to fuck it up.
  2. If you think that you haven’t fucked it up, you have. You just don’t know it yet.

With that in mind, there are three ways to control concurrency with locks. First, you can make fine-grained locks, which require a lot of bookkeeping and management. Secondly, you can also make coarse-grained locks, which are easier to implement but lead to a lot of contention. Finally, and this is perhaps the easiest solution, you can kill yourself. Believe me, number three looks pretty tempting after trying to find a thread related Heisenbug for two weeks.

But, if transactional memory comes into the picture, concurrent programming doesn’t have such a pessimistic outlook. No longer do you have to worry about how to control atomicity, you only have to worry about where to control atomicity.

Transactional memory lets you do things like this:

atomic {
    MyObject obj = myHashMap.get(key);
    obj.setSomeValue(x);
    myHashMap.remove(obj);
    myList.add(obj);
}

These operations are performed atomically, and you don’t need to worry about how it happens. Man, that beats the shit out of studying. Who’s up for a beer?

We Set Up Camp at the Bottom of the Bell Curve

Transactional memory is nothing new. Like most suspiciously ideal things, it originated in academia, where professors would explain their ideas starting with spitefully impractical phrases like “imagine a machine with infinite memory…,” and students like me would put on our best display of counterfeit interest.

There are two approaches to transactional memory: software and hardware. In Software Transactional Memory (STM), the system needs a thread to keep track of memory access, which, as you can imagine, usually eats up more resources than it saves. Hardware Transactional Memory (HTM) handles these memory operations on a chip. While hardware seems like the way to go, it just brings up a whole new host of problems. HTM implementations usually require the programmer to know some really esoteric stuff about his code (like the number of cache lines accessed by his transactions – what the shit?), and you end up at the same place you started: salad fork to the face.

I don’t want to think. I want to get paid the most amount of money for the least amount of work. Somebody please do the hard stuff for me.

Sun has come up with an approach that appeals to the lowest common denominator. They call it Hybrid Transactional Memory (HyTM), and it’s essentially an STM implementation that will use HTM when it’s available. As HTM gets better, code that uses HyTM gets faster automatically: no changes needed. The Rock CPU features HTM, so this isn’t just academic chest thumping.

End result to you and me is win, and copious amounts of it. It lets us program like I did in the snippet above without giving a thought to how things get done. Plus, it’s a hearty fuck-you to that guy on your team who is eerily good at using threads and locks. That reign of passive aggressive nerd dominance is over. He’ll have to find something else to be better-than-everyone at, and Kendo doesn’t count, Poindexter.

Some Transactions Leave You With Genital Warts

Sun Microsystems is about to horsefuck the database world, and nobody sees it coming. Imagine a SQL database that can support the absurd level of concurrency promised by HyTM. Conveniently, Sun owns one of the most popular relational databases in the world: MySQL. If MySQL on a single Rock based system can outperform Oracle or Microsoft spread across many systems, then DBAs worldwide would gladly tell Larry Ellison or Steve Ballmer where to shove it.

But will it actually work? Sun published a few papers about HyTM last year, and they were a shot across the bow to Oracle. Sun, it seems, employs some of the same passive aggressive nerds that your organization does. In their papers, they showed the effect that HyTM has on BerkeleyDB. Rewritten using Sun’s scheme, BDB’s locking subsystem achieves several orders of magnitude more throughput as the number of threads grows linearly. Oracle owns Sleepycat Software, the developers of BerkeleyDB. The dicks have been thrown down, and Sun’s is dragging in the dirt.

Of course, this isn’t all a fellatio session. Sun has yet to pull it off. At one point, the Rock chip was due in 2008, but now it’s been delayed to 2009. They could still scrap it and leave us with a severe case of blue balls. HyTM could fail to live up to expectations, leaving me looking like an idiot, or worse, it would invalidate my American dream, that I can slack off with reckless disregard for myself and others and still count on somebody to save my ass. ®

Ted Dziuba is a co-founder at Milo.com You can read his regular Reg column, Fail and You, every other Monday.

Steps to Take Before Choosing a Business Continuity Partner

Language

Answer to Chris: the f words used on this page are triggering the content filter on the Web connection in the educational institution where I work. At present, only this page is being blocked, but if such language becomes more common, the whole domain may be blocked. This would result in my students being unable to read the article and form their own opinion about the language.

I personally think it is possible to write about developments like this without gratuitous use of swear words and with a less 'flip' presentation style (thus saving words), but I accept that style is a question of taste. Web filtering policy isn't and is hard to get changed.

1
0

Try not to have a siezure...

Transactional Memory would save Windoze.....

The reason gates was pushing intel for faster and faster processors was windoze fails miserably at being multi-threaded.

Again try to not sieze up....

Yes applications can thread. The OS core however is a mismash of backward compatible crap that relies on wrapper after wrapper after wrapper API.

Let's say I have twenty badly written modules which don't thread very well but all must syncronize on a particular variable. Or perhaps I have an incredibly inadequate process scheduler that doesn't scale worth a damn past two cores....

If you don't believe me, then look at all the virtualization crap MS is pushing. You will never see windoze process monitor display 128 CPUs.... a "ps" on a sun T2+ does that easily...

I need backward compatibility but need scaling that doesn't break that compability. Transactional Memory puts the syncronization at the hardware level so a substantial amount of code just needs to be recompiled, not rewritten. This is not a problem with windoze cause a 300 megabyte service pack isn't scaring people as much as it used to.

So I predict, baring patent infringement, Intel will soon be touting "Hyper Transactional Memory" WOOOOOOOOO!

Let the flames begin....

0
0

If you don't like Chinese food...

...then don't move to China.

If you don't like swearing, then never leave the house or go on the internet or turn on any communication device or interact with other people in the world at all, ever. Simple. Then you won't be offended all the time.

This was a great article, made me laugh, was interesting too, well written and not utterly lame, spineless and basically a government/corporate sponsored missive like most journalism. Keep up the good work I say and next time I want my pizza with extra swear words, thanks.

Also, to the puritan-maid brigade, do you realise that every time you and your fellow religionuts search the internet through some kind of sterilizing proxy software that you are in fact invoking an incident of each swear word for every page you seach for? Whoever wrote the software had to type in, or make reference to another typed resource, the words: fuck, c*nt, piss, toffee, horsefuck (kudos), etc. And so each time you access any page your proxy asks: Does this page contain the word 'fuck'? No, OK then, what about 'shit'? OK then, what about 'horsefuck' (kudos)? So you are invoking thousands of utterances of swearwords all de day long my friend. Whoops...you're going to hell boy! If a tree falls in the forest and no-one's there to witness it, does it make a sound? If every swear word you've ever thought of and many you probably haven't are invoked hundreds of times a day by your internet browsing, do they still cause offence?

Are you also a pro-lifer who'd gladly kill a doctor at an abortion clinic?

Also, who the fuck do you think you are, telling other people what they can and can't say and what they can and can't hear? Fuck off and go and live in hole somewhere. I don't tell you how to live your life.

The swearing in this article made it more interesting and more professional in my opinion as it reflects the reality of how frustrating programming can be and the reality that a massive amount of people in the world form certain phonetics into certain words that have been classified by a tiny-minded tiny group of people as swear words, nothing more. What makes them swear words outside of your self-induced offence? There's a reason why it's called 'being offended' or 'taking offence' because it's purely subjective.

Grrr...I wish someone would horsefuck Windows Fista.

0
0

More from The Register

SCO vs. IBM battle resumes over ownership of Unix
Zombie lawsuit back and wants to suck the brains out of Linux
 breaking news
You don't need phone lines or cable for ANYTHING, says Dish
The satellite-dish man can sort you out with phone and broadband over the air too
 breaking news
What's HP got under wraps? Looks awfully flash and tape shaped
What happens in Vegas won't stay there - we've got the details
AMD lifts the veil on Opteron, ARM chip plans for 2014
Not much action going on in 2013, though
Microsoft borks botnet takedown in Citadel snafu
Stupid Redmond kicked over our honeypots, wail white hats
IBM's $1bn layoffs latest: Now axe swings in US, Canada - reports
Union claims 121 storage bods canned after dismal sales
NetApp musters muscular cluster bluster for ONTAP busters
Storage array OS overhauled to juggle more nodes, go down on you, er, less
HP adds 'Haswell' Xeon E3s to entry ProLiant servers
Gussies up MicroServer for SMBs, adds baby switches