Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×

Submission + - Demonstrating a Weakly-Ordered CPU (preshing.com)

Narnie writes: Jeff Preshing provides a C++11 demonstration of using shared memory on a weakly-ordered CPU and the resulting memory reordering when not properly using memory_order_acquire and memory_order_release constraints. Preshing writes in his blog:

If there’s one thing that characterizes a weakly-ordered CPU, it’s that one CPU core can read values from shared memory in a different order than another core wrote them. That’s what I’d like to demonstrate in this post using pure C++11. For normal applications, the x86/64 processor families from Intel and AMD do not have this characteristic. So we can forget about demonstrating this phenomenon on pretty much every modern desktop or notebook computer in the world. What we really need is a weakly-ordered multicore device. Fortunately, I happen to have one right here in my pocket: The iPhone 4S fits the bill. It runs on a dual-core ARM-based processor, and the ARM architecture is, in fact, weakly-ordered.

As commenter Ross Smith posted, "a rash of bug reports in multithreaded libraries and applications (occurred) around April 2011--Just after the iPad2 was released. That was the first mass market hardware with a multicore ARM CPU, and it gave a lot of supposedly threadsafe code a workout it had never had before."

The blog comes complete with some psudo-code, C++11 snippets, and the resulting assembly generated by the compiler.

Comment Re:yay, pointers... (Score 1) 326

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.

Comment Re:Project 1794?? (Score 1) 300

Wouldn't this be clearer for the slashdot crowd?

int [] nameProjectFromDate( int [] date ){
int i = date.length -1
while( i > 1 ){
          int tmp = date[i];
        date[i--] = date[i];
        date[i] = tmp;
}
return date;
}
(and yes I should have made it a void method that edited date directly, but you're not paying me to make good code.)

Comment Begs the question (Score 4, Interesting) 130

Given the numerous articles about copyright enforcement bots recently, it makes me wonder why there is so little human oversight about account banning. Or even attempting to match the author to the work to the copyright in question to the offending post. Apparently, it is better to throw out all the apples, and review the ones that that claim they aren't bad.

It also makes me wonder why it seems difficult to talk to an actual person at google about account restoration. I hope to never have to go through the process.

Slashdot Top Deals

Good day to avoid cops. Crawl to work.

Working...