Skip to content

Instantly share code, notes, and snippets.

@saisasidhar
Created November 27, 2019 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saisasidhar/48a0ccb4c0a9f4af5735d0419f684a93 to your computer and use it in GitHub Desktop.
Save saisasidhar/48a0ccb4c0a9f4af5735d0419f684a93 to your computer and use it in GitHub Desktop.
PyQt Strategy for CPU Bound Tasks
Managed By
Main Process ProcessPoolExecutor
+-------------------------------------------+ +---------------+
| MainThread QTaskRunner | | |
| +-----------+ +----------+ | executor.submit | +---------+ |
| | | | QThread +------------------->+ | P#1 | |
| | | | | | Future | | | |
| | | | +<-------------------+ | | |
| | | | | | PIPE | | +-----+ | |
| | | | +--+-----------------+--->+ | | |
| | | Signal | | parent_end child_end | | T | | |
| | +------------>+ | | | | | A | | |
| | | Slot | | | | | | S | | |
| | +<------------+ | | | | | K | | |
| | | | | | Future Complete | | | | | |
| | | | +<-------------------+ | +-----+ | |
| | | | | | | +---------+ |
| | | | | | | |
| | | | | | | +---------+ |
| | | | | | | | P#N | |
| +-----------+ +----------+ | | +---------+ |
| | | |
+-------------------------------------------+ +---------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment