a tumblelog
Wed 17 Mar 2021

Do Not Use '>' in Your Command Prompt

Over the years of troubleshooting performance problems in the Unix/Linux world, I have seen multiple cases where a regularly used command line tool in a customer server just stops working for some reason. The tool just returns immediately, doing absolutely nothing. No output printed, no coredumps and the exit code is zero (success!).

This article walks you through a couple of such incidents and in the end I explain how I avoid accidentally doing bad stuff in production in general.

Source: Do Not Use '>' in Your Command Prompt (and How to Stay Safe in Shell), an article by Tanel Põder.

Making lunch faster with Python concurrency

I'm going to tell a story to explain the different concurrency and parallelism options in Python.

In this story we will see how a single person multitasking is like concurrency, and multiple people doing their own tasks is like parallelism. We'll watch these scenarios in action at some well known lunchtime restaurants as they quickly and efficiently serve their customers. Then I'll implement these restaurants in Python, and finally I'll compare the different concurrency options and explain when to use each one.

I'll explain:

  • What the difference is between concurrency and parallelism?
  • The different concurrency options and how they compare, including threading, asyncio, multiprocessing and cloud functions
  • The pro and cons of each concurrency option
  • How to select your concurrency option using a single flowchart

Source: Making lunch faster with Python concurrency, an article by Brendan Maginnis.