Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does python have compare and swap operations

Trying to find if the python support CAS operations, lock free programming, concurrency like in java?

like image 842
user3914448 Avatar asked Aug 09 '14 13:08

user3914448


1 Answers

Python does not have those operations. Java has more sophisticated concurrency controls than Python does.

CPython (the typical implementation almost everyone uses) has a Global Interpreter Lock that you will want to understand.

Jython is a Python implementation on the JVM, and so shares many of the concurrency characteristics of Java.

like image 100
Ned Batchelder Avatar answered Oct 25 '22 17:10

Ned Batchelder