def detect_ncpus(): """Detects the number of effective CPUs in the system""" if iswindows: import win32api ans = win32api.GetSystemInfo()[5] else: import multiprocessing ans = -1 try: ans = multiprocessing.cpu_count() except Exception: from PyQt5.Qt import QThread ans = QThread.idealThreadCount() return max(1, ans)
def detect_ncpus(): """Detects the number of effective CPUs in the system""" if iswindows: import win32api ans = win32api.GetSystemInfo()[5] else: import multiprocessing ans = -1 try: ans = multiprocessing.cpu_count() except Exception: from PyQt5.Qt import QThread ans = QThread.idealThreadCount() return max(1, ans)