Assign unique shm keys for duplicate fsps to avoid array clobbering

pause_feeds_on_sym_switch
Tyler Goodlet 2021-09-05 13:20:50 -04:00
parent 829820060f
commit 24c3f84496
1 changed files with 8 additions and 5 deletions

View File

@ -280,7 +280,7 @@ class LinkedSplits(QtWidgets.QWidget):
# self.xaxis.hide() # self.xaxis.hide()
self.splitter = QtWidgets.QSplitter(QtCore.Qt.Vertical) self.splitter = QtWidgets.QSplitter(QtCore.Qt.Vertical)
self.splitter.setMidLineWidth(2) self.splitter.setMidLineWidth(1)
self.splitter.setHandleWidth(0) self.splitter.setHandleWidth(0)
self.layout = QtWidgets.QVBoxLayout(self) self.layout = QtWidgets.QVBoxLayout(self)
@ -1152,6 +1152,8 @@ async def spawn_fsps(
linkedsplits.focus() linkedsplits.focus()
uid = tractor.current_actor().uid
# spawns sub-processes which execute cpu bound FSP code # spawns sub-processes which execute cpu bound FSP code
async with tractor.open_nursery(loglevel=loglevel) as n: async with tractor.open_nursery(loglevel=loglevel) as n:
@ -1172,7 +1174,7 @@ async def spawn_fsps(
# TODO: should `index` be a required internal field? # TODO: should `index` be a required internal field?
fsp_dtype = np.dtype([('index', int), (fsp_func_name, float)]) fsp_dtype = np.dtype([('index', int), (fsp_func_name, float)])
key = f'{sym}.' + display_name key = f'{sym}.fsp.{display_name}.{".".join(uid)}'
# this is all sync currently # this is all sync currently
shm, opened = maybe_open_shm_array( shm, opened = maybe_open_shm_array(
@ -1182,9 +1184,10 @@ async def spawn_fsps(
readonly=True, readonly=True,
) )
# XXX: fsp may have been opened by a duplicate chart. Error for # XXX: fsp may have been opened by a duplicate chart.
# now until we figure out how to wrap fsps as "feeds". # Error for now until we figure out how to wrap fsps as
# assert opened, f"A chart for {key} likely already exists?" # "feeds". assert opened, f"A chart for {key} likely
# already exists?"
conf['shm'] = shm conf['shm'] = shm