Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallellize the tracker #6

Open
andim opened this issue Mar 22, 2017 · 4 comments
Open

Parallellize the tracker #6

andim opened this issue Mar 22, 2017 · 4 comments

Comments

@andim
Copy link
Owner

andim commented Mar 22, 2017

From @feranick on October 10, 2014 21:6

Either multiprocessing or multithreading. This should also help in solving issue feranick/issues/3

Copied from original issue: feranick#39

@andim
Copy link
Owner Author

andim commented Mar 22, 2017

@andim
Copy link
Owner Author

andim commented Mar 22, 2017

From @feranick on October 10, 2014 22:28

This is still very relevant during acquisition, not just for the slider.

@mgrady3
Copy link

mgrady3 commented Nov 7, 2017

I thought I had chimed in on this earlier.

I went through a number of tests with parallelizing things in my Qt applications. The conclusions I came to we're that the only definite way to do so was to sidestep the Python GIL using one of two methods:

Use multiprocessing (not the Python threading library nor the Qthreads framework from Qt) to create multiple processes to execute tasks. This is a simple framework of you just have one or two tasks that you need to execute on a set of data that are effectively independent of each other, but gets complex if you need communication between the processes.

The other way is simply to leave the Python realm and use another language to do the parallel work. The easiest would be C/C++ of Fortran, however Go and Rust are becoming possibilities these days. This will allow your tasks to run free on the Python GIL, but comes with the downsides of having to use another language as well as complicating the distribution of your code to other users.

Neither of these solutions is necessarily easy, but that's just about the only option. Simple multithreading with Python threads or the Qthread framework won't work for cpu-bound tasks in python because the GIL prevents multiple threads from simultaneously executing code.

@feranick
Copy link
Collaborator

Python 3.13 is set to be the first release with no-GIL (at least in the experimental stage). We might want to consider multithreading once Python 3.13+ reaches critical mass adoption.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants