[vtkusers] Python Bindings & GIL (Blocking issues)

Christopher Denter dennda at the-space-station.com
Thu Jan 21 15:27:38 EST 2010


Hello,

in my particular case I have been able to work around the problem to some degree by using callbacks for ProgressEvents (I need those anyway for a progress bar) and a bad hack.
The bad hack is now that each time the callback is called, I make the thread sleep for 0.05 seconds so that the main thread has some time to catch up.

Of course this is not a proper solution but just a bad hack. It helps animate a progress bar though.

Jose, please make sure to hit 'Reply All' to also send a mail to the VTK mailing list.

HTH,
	Christopher

On 21. Jan, 2010, at 4:11 PM, Lic. José M. Rodriguez Bacallao wrote:

> I have the same issue, with vtk and PyQt threads or python threads,
> any suggestions?
> 
> On 1/20/10, Christopher Denter <dennda at the-space-station.com> wrote:
>> Hello.
>> 
>> In my application I want to load a large dataset in a different thread to
>> keep the UI responsive. However, as soon as the VTK code is executed, only
>> that one thread runs and my UI freezes for the duration of the loading
>> operation. Do the VTK bindings block the python interpreter?
>> VTK_NO_PYTHON_THREADS is disabled. I'm running Python 2.6.4 on OSX 10.6.
>> 
>> (To be precise, all the thread does currently - for testing reasons - is
>> create a vtkDICOMImageReader and read a dataset. If I replace all VTK
>> related stuff with a simple time.sleep(10), the UI remains responsive, hence
>> my conclusion.)
>> 
>> Thanks,
>> 	Christopher
>> _______________________________________________
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>> 
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>> 
> 
> 
> -- 
> Lic. José M. Rodriguez Bacallao
> Centro de Biofisica Medica
> -----------------------------------------------------------------
> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.
> 
> Recuerda: El arca de Noe fue construida por aficionados, el titanic
> por profesionales
> -----------------------------------------------------------------




More information about the vtkusers mailing list