From: Francesc A. <fa...@ca...> - 2004-12-15 13:53:44
|
Hi Andrew, A Dimecres 15 Desembre 2004 03:49, Andrew Straw va escriure: > I enclose a small patch (against CVS HEAD) which demonstrates how to=20 > release the GIL during potentially long operations. I think all=20 > potentially long operations (basically most of the C H5* functions)=20 > should be bracketed by these statements. Done. I've applied your patch, and besides, looked at the places where potentially long operations would happen and backeted them by BEGIN_ALLOW_THREADS/END_ALLOW_THREADS. After some work (some variables passed to the C functions were Python objects), all the tests units pass fine. The patched version is already in CVS HEAD. > For example purposes, I've only tracked down this single operation. If=20 > you'd like any more explanation/justification/etc., please let me know=20 > and I'll do my best. I think it would be interesting if you can provide some (small) example on how you can speed-up your I/O by using threading. I can manage to put that example (or similar) in the chapter of "Optimization Tips" in PyTables manual. By the way, do you think that doing multithreading on a single-CPU machine would made some processes more efficient? I mean, if you have a thread for reading and other for processing the read data, perhaps you can get some speed-up (while I doubt it, that would be just great). Thanks for your contribution! =2D-=20 =46rancesc Altet Who's your data daddy? =A0PyTables |