What are atomic operations for newbies?

Pretty much, yes. “Atom” comes from greek “atomos” = “uncuttable”, and has been used in the sense “indivisible smallest unit” for a very long time (till physicists found that, in fact, there are smaller things than atoms). In concurrent programming, it means that there will be no context switch during it – nothing can affect the execution … Read more

How can I safely create a nested directory in Python?

On Python ≥ 3.5, use pathlib.Path.mkdir: For older versions of Python, I see two answers with good qualities, each with a small flaw, so I will give my take on it: Try os.path.exists, and consider os.makedirs for the creation. As noted in comments and elsewhere, there’s a race condition – if the directory is created between the os.path.exists and the os.makedirs calls, the os.makedirs will … Read more

What is the meaning of *nix?

*nix just means operating systems that are like the old workhorse Unix. Some examples include Linux, FreeBSD, and Mac OS X (its kernel, Darwin, is based on BSD). The main relation between *nix and Ruby is just a pragmatic one; most Ruby developers seem to prefer to work on Unix-like OSes (typically Linux or Mac … Read more

What’s a Pthread?

Threads are a generic concept. Wikipedia defines it as: In computer science, a thread of execution is the smallest sequence of programmed instructions that can be managed independently by an operating system scheduler. A thread is a light-weight process. Pthreads or POSIX threads are one implementation of that concept used with C program on Unix. … Read more