[openstack-dev] [all] Replace mysql-python with mysqlclient

Robert Collins robertc at robertcollins.net
Tue May 12 01:06:21 UTC 2015


On 12 May 2015 at 10:12, Attila Fazekas <afazekas at redhat.com> wrote:
>
>
>
>

>> If you can illustrate a test script that demonstrates the actual failing
>> of OS threads that does not occur greenlets here, that would make it
>> immediately apparent what it is you're getting at here.
>>
>
> http://www.fpaste.org/220824/raw/
>
> I just put together hello word C example and a hello word threading example,
> and replaced the print with sleep(3).
>
> When I use the sleep(3) from python, the 5 thread program runs in ~3 second,
> when I use the sleep(3) from native code, it runs ~15 sec.
>
> So yes, it is very likely a GIL lock wait related issue,
> when the native code is not assisting.

Your test code isn't releasing the GIL here, and I'd expect C DB
drivers to be releasing the GIL: you've illustrated how a C extension
can hold the GIL, but not whether thats happening.

> Do you need a DB example, by using the mysql C driver,
> and waiting in an actual I/O primitive ?

waiting in an I/O primitive is fine as long as the GIL has been released.

-Rob


-- 
Robert Collins <rbtcollins at hp.com>
Distinguished Technologist
HP Converged Cloud



More information about the OpenStack-dev mailing list