python:isnt_java
Python Isn't Java
Some things in Python are infeasible to implement as they existed in Java. This page lists some things.
Threading
Python has threads, but there are several limitations.
- When a Future is cancelled, the task is not aware of the cancellation. This is because there is no `mayInterruptIfRunning`. This means cancelling a future just marks the future as cancelled, but doesn't actually notify they threads they should stop.
- There is no thread interruption. It's not possible to stop waiting on several core types.
- Semaphore.acquire() cannot be interrupted. There is no
tryAcquire()method either. - Conditions can only be interrupted by the notifier.
python/isnt_java.txt · Last modified: by carl
