[PyQt] Are QThreads compatible with python's threading.RLock?
dsdale24 at gmail.com
Sun Jul 27 13:55:02 BST 2008
On Saturday 26 July 2008 03:48:53 you wrote:
> On Fri, 25 Jul 2008 17:41:22 -0400, Darren Dale <dsdale24 at gmail.com> wrote:
> > I use a library that provides rudimentary thread safety of its objects
> > file
> > I/O using threading.RLock from the python standard library. Could anyone
> > tell
> > me if PyQt4's QThreads are compatible with these recursive locks?
> Other than the fact that they will both be implemented using the same OS
> primitives, Python's and Qt's threading know nothing about each other.
Thanks Phil. The author of this other library I use added a mechanism to
accommodate alternative threading libraries: users can provide their own lock
object, provided it is reentrant and respect python's context manager
protocol. So I think I can can do this:
def __exit__(self, type, value, traceback):
h5.config.RLock = MyRLock
One last question, concerning context managers: I think the current PyQt4 way
but if QMutex and friends had __enter__ and __exit__ methods, like MyRLock, we
Is there a reason (performance?) for using Qt's QMutexLocker to provide the
context manager, rather than the QMutex itself?
More information about the PyQt