[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] QtSql and releasing GIL
From:       Arve Knudsen <arve.knudsen () gmail ! com>
Date:       2014-04-22 10:58:58
Message-ID: CAEDa091uLqm4pNHkMrK5349xK+vWWNMBQhe8ohs-aCS02ENN6A () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I patched PyQt, but it doesn't build for me at the moment due to something
to do with OpenGL (maybe I need to reinstall Qt). It doesn't really matter
though, since I discovered I can query via QSqlQuery.exec_ instead, which
does release the GIL! When using this method, I can confirm that the app no
longer hangs.

Best,
Arve


On Tue, Apr 22, 2014 at 12:43 PM, Arve Knudsen <arve.knudsen@gmail.com>wrote:

> On Tue, Apr 22, 2014 at 12:38 PM, Phil Thompson <
> phil@riverbankcomputing.com> wrote:
>
>> On 22/04/2014 11:32 am, Arve Knudsen wrote:
>>
>>> On Tue, Apr 22, 2014 at 12:29 PM, Phil Thompson
>>> <phil@riverbankcomputing.com> wrote:
>>>
>>>  On 22/04/2014 11:22 am, Arve Knudsen wrote:
>>>>
>>>>  I am experiencing this issue again.it [1] [1]'s QtSql.QSqlQuery
>>>>>
>>>>> that
>>>>>
>>>>> locks up the application, even though it runs in a non-UI thread.
>>>>> I've
>>>>> confirmed that the main thread has relinquished control back to
>>>>> the Qt
>>>>> event loop.
>>>>>
>>>>> It's a total showstopper at the moment, so I'm considering
>>>>> querying in
>>>>> a separate process instead.
>>>>>
>>>>> Arve
>>>>>
>>>>
>>>> Sorry I've just realised that my comment below is completely wrong.
>>>> The GIL is released for next() but nor for value() or any ctor. Can
>>>> you confirm exactly which function it is locking up in?
>>>>
>>>
>>> I mean the QtSql.QSqlQuery ctor.
>>>
>>
>> Which one?
>>
>
> The one accepting a QString.
>
>
>> Try adding /ReleaseGIL/ to it and rebuild.
>
>
> I'm on it :)
>
> Arve
>

[Attachment #5 (text/html)]

<div dir="ltr">I patched PyQt, but it doesn&#39;t build for me at the moment due to \
something to do with OpenGL (maybe I need to reinstall Qt). It doesn&#39;t really \
matter though, since I discovered I can query via QSqlQuery.exec_ instead, which does \
release the GIL! When using this method, I can confirm that the app no longer \
hangs.<div> <br></div><div>Best,</div><div>Arve</div></div><div \
class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 22, 2014 at 12:43 \
PM, Arve Knudsen <span dir="ltr">&lt;<a href="mailto:arve.knudsen@gmail.com" \
target="_blank">arve.knudsen@gmail.com</a>&gt;</span> wrote:<br> <blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div \
class="gmail_quote"><div><div class="h5">On Tue, Apr 22, 2014 at 12:38 PM, Phil \
Thompson <span dir="ltr">&lt;<a href="mailto:phil@riverbankcomputing.com" \
target="_blank">phil@riverbankcomputing.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div>On 22/04/2014 11:32 am, Arve Knudsen wrote:<br> \
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div> On Tue, Apr 22, 2014 at 12:29 PM, Phil Thompson<br>
&lt;<a href="mailto:phil@riverbankcomputing.com" \
target="_blank">phil@riverbankcomputing.com</a>&gt; wrote:<br> <br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div> On 22/04/2014 11:22 am, Arve Knudsen wrote:<br>
<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> I am experiencing this issue <a href="http://again.it" \
target="_blank">again.it</a> [1] [1]&#39;s  QtSql.QSqlQuery<div><br> that<br>
<br>
locks up the application, even though it runs in a non-UI thread.<br>
I&#39;ve<br>
confirmed that the main thread has relinquished control back to<br>
the Qt<br>
event loop.<br>
<br>
It&#39;s a total showstopper at the moment, so I&#39;m considering<br>
querying in<br>
a separate process instead.<br>
<br>
Arve<br>
</div></blockquote><div>
<br>
Sorry I&#39;ve just realised that my comment below is completely wrong.<br>
The GIL is released for next() but nor for value() or any ctor. Can<br>
you confirm exactly which function it is locking up in?<br>
</div></blockquote><div>
<br>
I mean the QtSql.QSqlQuery ctor.<br>
</div></blockquote>
<br>
Which one?<br></blockquote><div><br></div></div></div><div>The one accepting a \
QString.</div><div class=""><div>  </div><blockquote class="gmail_quote" \
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Try adding /ReleaseGIL/ to it and \
rebuild.</blockquote><div><br></div></div><div>I&#39;m on it :)  </div><span \
class="HOEnZb"><font \
color="#888888"><div><br></div><div>Arve</div></font></span></div></div></div> \
</blockquote></div><br></div>


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic