The ability to execute code in parallel is crucial in a wide variety of scenarios. Concurrent programming is a key asset for web servers, producer/consumer models, batch number-crunching and pretty much any time an application is bottlenecked by a resource.
It’s sadly the case that writing quality concurrent code can be a real headache, but this article aims to demonstrate how easy it is to get started writing threaded programs in Python. Due to the large number of modules available in the standard library which are there to help out with this kind of thing, it’s often the case that simple concurrent tasks are surprisingly quick to implement.
We’ll walk through the difference between threads and processes in a Python context, before reviewing some of the different approaches you can take and what they’re best suited for.
Continue reading “Thread Carefully: An Introduction To Concurrent Python”
As the adage goes, “if you want something done right, do it yourself.” Desirous of a tablet but preferring to eschew consumer models, [Stefan Vorkoetter] constructed his own compact and lightweight Raspberry Pi tablet, covering several extra miles in the process.
The tablet makes use of a Raspberry Pi 3 and the official touchscreen, with the final product marginally larger than the screen itself. Designed with a ‘slimmer the better’ profile in mind, [Vorkoetter] had to modify several components to fit this precept; most obvious of these are the removal of the Pi’s GPIO headers, USB, and Ethernet ports, and removing the USB power out port from the touchscreen controller board so the two could be mounted side-by-side.
An Adafruit PowerBoost 1000C handles charging the 6200 mAh battery — meaning up to six hours(!) of YouTube videos — via a micro USB, but only after [Vorkoetter] attached a pair of home-made heatsinks due to negligible air flow within the case. A modified USB audio adapter boosts the Pi’s audio capabilities, enabling the use of headphones, a mic, and a built-in speaker which is attached to the tablet’s back cover.
Continue reading “Huge Functionality, Small Package: A Custom Tablet, Raspberry Style”