Re: [PyKDE] QWaitCondition seems to cause deadlock

2004-05-25 Thread Phil Thompson
On Tuesday 25 May 2004 1:14 pm, Shin-ichi MORITA wrote:
> Hi,
>
> I found another one ...
> QThread.wait() dosen't have /ReleaseGIL/ as well.
>
> I hope this is the last.

Thanks - just made it for 3.12.

Phil

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Re: [PyKDE] QWaitCondition seems to cause deadlock

2004-05-25 Thread Shin-ichi MORITA
Hi,

I found another one ...
QThread.wait() dosen't have /ReleaseGIL/ as well.

I hope this is the last.

> It
> > looks like it's missing 
> > on QMutex.lock() as well. Tonight's snapshot
> should
> > be fixed.


__
Do You Yahoo!?
http://bb.yahoo.co.jp/

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Re: [PyKDE] QWaitCondition seems to cause deadlock

2004-05-19 Thread Shin-ichi MORITA
# I sent my name in KANJI. my mistake ...

Thank you for your quick response.

> > I think that QWaitCondition::wait() must have
> /ReleaseGIL/
> > annotation, is that right?
> 
> Reading the documentation, I think you are right. It
> looks like it's missing 
> on QMutex.lock() as well. Tonight's snapshot should
> be fixed.

Yeah, I think so.

> Thanks,
> Phil


__
Do You Yahoo!?
http://bb.yahoo.co.jp/

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Re: [PyKDE] QWaitCondition seems to cause deadlock

2004-05-18 Thread Phil Thompson
On Tuesday 18 May 2004 5:58 pm, 森田 慎一 wrote:
> Hi, this is shin.
> It's my first time to post to this ml.
>
> I'm a beginner of PyQt.
> PyQt is very exciting!!
> But I have a problem on my multi-thread script.
>
> This script uses Qt thread API, and uses QMutex and
> QWaitCondition to synchronize a GUI thread and a worker
> thread.
> When the worker thread calls QWaitCondition.wait(), GUI
> thread also stops running.
> It seems to be in deadlock state.
>
> The worker's code is as follows:
>
> def postAndWait(self)
> mutex.lock()
> QApplication::postEvent(receiver,
> QCustomEvent(QEvent.User))
> # waits until GUI thread processes the posted event.
> condition.wait(mutex) # <-- stops everything!!
> mutex.unlock()
>
> GUI thread processes events as follows:
>
> def customEvent(self, event)
> mutex.lock()
> # do something ...
> condition.wakeAll()
> mutex.unlock()
>
> I've been at a loss for a few days.
> But today I found that Python Global Interpreter Lock
> needs to be released and reacquired around blocking
> operation according to Python C/API Reference Manual.
> And I also found that QWaitCondition::wait()  in
> qwaitcondition.sip has no annotation while
> QThread::sleep() has /ReleaseGIL/ annotation.
>
> I think that QWaitCondition::wait() must have /ReleaseGIL/
> annotation, is that right?

Reading the documentation, I think you are right. It looks like it's missing 
on QMutex.lock() as well. Tonight's snapshot should be fixed.

Thanks,
Phil

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

[PyKDE] QWaitCondition seems to cause deadlock

2004-05-18 Thread 森田 慎一
Hi, this is shin.
It's my first time to post to this ml.

I'm a beginner of PyQt.
PyQt is very exciting!!
But I have a problem on my multi-thread script.

This script uses Qt thread API, and uses QMutex and
QWaitCondition to synchronize a GUI thread and a worker
thread.
When the worker thread calls QWaitCondition.wait(), GUI
thread also stops running.
It seems to be in deadlock state.

The worker's code is as follows:

def postAndWait(self)
mutex.lock()
QApplication::postEvent(receiver,
QCustomEvent(QEvent.User))
# waits until GUI thread processes the posted event.
condition.wait(mutex) # <-- stops everything!!
mutex.unlock()

GUI thread processes events as follows:

def customEvent(self, event)
mutex.lock()
# do something ...
condition.wakeAll()
mutex.unlock()

I've been at a loss for a few days.
But today I found that Python Global Interpreter Lock
needs to be released and reacquired around blocking
operation according to Python C/API Reference Manual.
And I also found that QWaitCondition::wait()  in
qwaitcondition.sip has no annotation while
QThread::sleep() has /ReleaseGIL/ annotation.

I think that QWaitCondition::wait() must have /ReleaseGIL/
annotation, is that right?



__
Do You Yahoo!?
http://bb.yahoo.co.jp/

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde