Multiprocessing vs Threading Python

The threading module uses threads, the multiprocessing module uses processes. The difference is that threads run in the same memory space, while processes have separate memory. This makes it a bit harder to share objects between processes with multiprocessing. Since threads use the same memory, precautions have to be taken or two threads will write to the same memory … Read more

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

What is the difference between a process and a thread?

Both processes and threads are independent sequences of execution. The typical difference is that threads (of the same process) run in a shared memory space, while processes run in separate memory spaces. I’m not sure what “hardware” vs “software” threads you might be referring to. Threads are an operating environment feature, rather than a CPU … 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

What’s the difference between deadlock and livelock?

Taken from http://en.wikipedia.org/wiki/Deadlock: In concurrent computing, a deadlock is a state in which each member of a group of actions, is waiting for some other member to release a lock A livelock is similar to a deadlock, except that the states of the processes involved in the livelock constantly change with regard to one another, … Read more