Python Ditches The GILs And Comes Ashore

The Python world has been fractured a few times before. The infamous transition from version 2 to version 3 still affects people today, and there could be a new schism in the future. [Sam Gross] proposed a solution to drop the Global Interrupt Interpreter Lock (GIL), which would have enormous implications for many projects that leverage the CPython internals, such as Pandas and NumPy.

The fact that Python is interpreted is a double edge sword. It means there can be different runtimes, such as Pyston, Cinder, MicroPython, PyPy, and others, that might support the whole language, a specific version, or a subset. But if you’re using Python, you’re probably running CPython. And it has something known as global interpreter lock that affects threaded code. In a nutshell, only one thread can run in the interpreter at a time. There are some ways around it, such as moving performance-critical sections to C or having multiple interpreters. However, most existing solutions come with considerable downsides. Continue reading “Python Ditches The GILs And Comes Ashore”

How To Get Into Cars: Endurance Racing Builds

Many an automotive enthusiast finds themselves at a track day eventually. Typically, this involves competing against the clock to better one’s laptimes in short sessions throughout the day. Such events are fun, but it often creates a perishing thirst for a greater level of competition.

Regularity and endurance events are often the next step up for a lot of people. These events involve long runs at race pace that stress a car to (or beyond!) the breaking point. Careful preparation is required if one is to see out the race to the chequered flag. Let’s break down what you’ll need to consider.

Continue reading “How To Get Into Cars: Endurance Racing Builds”

30 Days Of Terror: The Logistics Of Launching The James Webb Space Telescope

Back during the 2019 Superconference in Pasadena, I had the chance to go to Northrop Grumman’s Redondo Beach campus to get a look at the James Webb Space Telescope. There is the high-bay class 10,000+ cleanroom in building M8, my wife and I along with fellow space nerd Tom Nardi got a chance to look upon what is likely the most expensive single object ever made. The $10 billion dollar space observatory was undergoing what we thought were its final tests before being packaged up and sent on its way to its forever home at the L2 Lagrange point.

Sadly, thanks to technical difficulties and the COVID-19 pandemic, it would be another two years before JWST was actually ready to ship — not a new story for the project, Mike Szczys toured the same facility back in 2015. But the good news is that it finally has shipped, taking the very, very slow first steps on its journey to space.

Both the terrestrial leg of the trip and the trip through 1.5 million kilometers of space are fraught with peril, of a different kind, of course, but still with plenty of chances for mission-impacting events. Here’s a look at what the priceless and long-awaited observatory will face along the way, and how its minders will endure the “30 days of terror” that lie ahead.

Continue reading “30 Days Of Terror: The Logistics Of Launching The James Webb Space Telescope”

Magnesium: Where It Comes From And Why We’re Running Out

Okay, we’re not running out. We actually have tons of the stuff. But there is a global supply chain crisis. Most of the world’s magnesium is processed in China and several months ago, they just… stopped. In an effort to hit energy consumption quotas, the government of the city of Yulin (where most of the country’s magnesium production takes place) ordered 70% of the smelters to shut down entirely, and the remainder to slash their output by 50%. So, while magnesium remains one of the most abundant elements on the planet, we’re readily running out of processed metal that we can use in manufacturing.

Nikon camera body
The magnesium-alloy body of a Nikon d850. Courtesy of Nikon

But, how do we actually use magnesium in manufacturing anyway? Well, some things are just made from it. It can be mixed with other elements to be made into strong, lightweight alloys that are readily machined and cast. These alloys make up all manner of stuff from race car wheels to camera bodies (and the chassis of the laptop I’m typing this article on). These more direct uses aside, there’s another, larger draw for magnesium that isn’t immediately apparent: aluminum production.

But wait, aluminum, like magnesium is an element. So why would we need magnesium to make it? Rest assured, there’s no alchemy involved- just alloying. Much like magnesium, aluminum is rarely used in its raw form — it’s mixed with other elements to give it desirable properties such as high strength, ductility, toughness, etc. And, as you may have already guessed, most of these alloys require magnesium. Now we’re beginning to paint a larger, scarier picture (and we just missed Halloween!) — a disruption to the world’s aluminum supply.

Continue reading “Magnesium: Where It Comes From And Why We’re Running Out”

The Pi Zero 2 W Is The Most Efficient Pi

Last week we saw the announcement of the new Raspberry Pi Zero 2 W, which is basically an improved quad-core version of the Pi Zero — more comparable in speed to the Pi 3B+, but in the smaller Zero form factor. One remarkable aspect of the board is the Raspberry-designed RP3A0 system-in-package, which includes the four CPUs and 512 MB of RAM all on the same chip. While 512 MB of memory is not extravagant by today’s standards, it’s workable. But this custom chip has a secret: it lets the board run on reasonably low power.

When you’re using a Pi Zero, odds are that you’re making a small project, and maybe even one that’s going to run on batteries. The old Pi Zero was great for these self-contained, probably headless, embedded projects: sipping the milliamps slowly. But the cost was significantly slower computation than its bigger brothers. That’s the gap that the Pi Zero 2 W is trying to fill. Can it pull this trick off? Can it run faster, without burning up the batteries? Raspberry Pi sent Hackaday a review unit that I’ve been running through the paces all weekend. We’ll see some benchmarks, measure the power consumption, and find out how the new board does.

The answer turns out to be a qualified “yes”. If you look at mixed CPU-and-memory tasks, the extra efficiency of the RP3A0 lets the Pi Zero 2 W run faster per watt than any of the other Raspberry boards we tested. Most of the time, it runs almost like a Raspberry Pi 3B+, but uses significantly less power.

Along the way, we found some interesting patterns in Raspberry Pi power usage. Indeed, the clickbait title for this article could be “We Soldered a Resistor Inline with Raspberry Pis, and You Won’t Believe What Happened Next”, only that wouldn’t really be clickbait. How many milliamps do you think a Raspberry Pi 4B draws, when it’s shut down? You’re not going to believe it.

Continue reading “The Pi Zero 2 W Is The Most Efficient Pi”

This Week In Security:Use-After-Free For Dummies, WiFi Cracking, And PHP-FPM

In a brilliant write-up, [Stephen Tong] brings us his “Use-After-Free for Dummies“. It’s a surprising tale of a vulnerability that really shouldn’t exist, and a walkthrough of how to complete a capture the flag challenge. The vulnerable binary is running on a Raspberry Pi, which turns out to be very important. It’s a multithreaded application that uses lock-free data sharing, through pair of integers readable by multiple threads. Those ints are declared using the volatile keyword, which is a useful way to tell a compiler not to optimize too heavily, as this value may get changed by another thread.

On an x86 machine, this approach works flawlessly, as all the out-of-order execution features are guaranteed to be globally transparent. Put another way, even if thread one can speed up execution by modifying shared memory ahead of time, the CPU will keep the shared memory changes in the proper order. When that shared memory is controlling concurrent access, it’s really important that ordering happens the way you expect it. What was a surprise to me is that the ARM platform does not provide that global memory ordering. While the out-of-order execution will be transparent to the thread making changes, other threads and processes may observe those actions out of order. An example may help:

volatile int value;
volatile int ready;

// Thread 1
value = 123; // (1)
ready = 1; // (2)

// Thread 2
while (!ready); // (3)
print(value); // (4)

Continue reading “This Week In Security:Use-After-Free For Dummies, WiFi Cracking, And PHP-FPM”

Four More Talks Added To The 2021 Remoticon Lineup

We’ve already unveiled multiple keynote speakers and a slate of fascinating presenters that will be showing off everything from reverse engineering vintage calculators to taking those first tentative steps on your CAD journey for this year’s Remoticon. You’d be forgiven for thinking that’s everything you’ll see at the conference, but there’s still plenty to announce before the two-day virtual event kicks off on November 19th. Normally we’d be promising to make sure you get your money’s worth, but since tickets are completely free, we’re shooting a bit higher than that.

We were blown away by the number of fantastic talk proposals we received during this year’s extended call. Let’s take a look at the next four presenters who will be joining us for the 2021 Hackaday Remoticon on November 19th through the 20th.

Continue reading “Four More Talks Added To The 2021 Remoticon Lineup”