From 583cafc947f0c3ede92657bd14e843e7a74d998c Mon Sep 17 00:00:00 2001 From: wattygetlood <61716739+wattygetlood@users.noreply.github.com> Date: Sun, 28 Mar 2021 17:23:59 -0400 Subject: [PATCH 1/2] Avoid loading posix unlinker, use shm bytes size --- piker/data/_sharedmem.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/piker/data/_sharedmem.py b/piker/data/_sharedmem.py index fb442d7c..3dc8de89 100644 --- a/piker/data/_sharedmem.py +++ b/piker/data/_sharedmem.py @@ -22,7 +22,9 @@ from sys import byteorder from typing import List, Tuple, Optional from multiprocessing.shared_memory import SharedMemory, _USE_POSIX from multiprocessing import resource_tracker as mantracker -from _posixshmem import shm_unlink + +if _USE_POSIX: + from _posixshmem import shm_unlink import tractor import numpy as np @@ -73,7 +75,7 @@ class SharedInt: @value.setter def value(self, value) -> None: - self._shm.buf[:] = value.to_bytes(4, byteorder) + self._shm.buf[:] = value.to_bytes(self._shm.size, byteorder) def destroy(self) -> None: if _USE_POSIX: From c39c4f11dbac338c2fc46e743150fec1c5e699d9 Mon Sep 17 00:00:00 2001 From: wattygetlood <61716739+wattygetlood@users.noreply.github.com> Date: Sun, 28 Mar 2021 17:24:30 -0400 Subject: [PATCH 2/2] Forcinng trio spawner seems to work? --- piker/ui/_exec.py | 1 + 1 file changed, 1 insertion(+) diff --git a/piker/ui/_exec.py b/piker/ui/_exec.py index eb0d662c..68611334 100644 --- a/piker/ui/_exec.py +++ b/piker/ui/_exec.py @@ -200,6 +200,7 @@ def run_qtractor( tractor._root._default_arbiter_port, ), name='qtractor', + start_method='trio', **tractor_kwargs, ): await func(*((widgets,) + args))