Live data from Hacker News

Python Locks, RLocks, Semaphores, Conditions, Events and Queues

laurentluce.com

1–5 of 5 posts

Re: Python Locks, RLocks, Semaphores, Conditions, Events and Queues

#2
While the OP talks specifically about Python, the patterns of a semaphore, lock (aka mutex, a semaphore with value 1), condition and queue are relevant to many languages, many of which are not hampered by a GIL. Personally, the more I use threads, the more I like this way of programming, at least for the request/response paradigm.

Re: Python Locks, RLocks, Semaphores, Conditions, Events and Queues

#3

While the OP talks specifically about Python, the patterns of a semaphore, lock (aka mutex, a semaphore with value 1), condition and queue are relevant to many languages, many of which are not hampered by a GIL. Personally, the more I use threads, the more I like this way of programming, at least for the request/response paradigm.

Try writing an operating system. Then let me know if you still like programming with threads.

Re: Python Locks, RLocks, Semaphores, Conditions, Events and Queues

#5

While the OP talks specifically about Python, the patterns of a semaphore, lock (aka mutex, a semaphore with value 1), condition and queue are relevant to many languages, many of which are not hampered by a GIL. Personally, the more I use threads, the more I like this way of programming, at least for the request/response paradigm.

Try writing an operating system. Then let me know if you still like programming with threads.

That is an entirely different problem than the one I typically face. Also while I have no experience writing OS's, but IIRC none of the modern ones have their processes based on event loop. Maybe writing an OS is just not a trivial problem and the code is bound to be somewhat ugly.