Skip to content

Instantly share code, notes, and snippets.

@tameem92
Created May 19, 2020 12:29
Show Gist options
  • Save tameem92/2666846e7ca37457ea04b72c5235b48b to your computer and use it in GitHub Desktop.
Save tameem92/2666846e7ca37457ea04b72c5235b48b to your computer and use it in GitHub Desktop.
"""
Many Qt functions are not threadsafe. If you use function callback,
even if you put locks around all of YOUR draw calls, you will segfault
because Qt's main event loop is still running and using
resources without locks.
"""
from multiprocessing.pool import ThreadPool
import sys
from threading import Lock
import time
from PyQt5 import QtCore, QtWidgets
class Task(QtCore.QObject):
updated = QtCore.pyqtSignal(int, int)
...............
...............
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment