SilverMoon

Search Ctrl K

SilverMoon

Search Ctrl K
art
视频剪辑
interesting
color
jinqi
HOWTO
如何在面试中提出好的问题
unibo
faikr
M1
Automated Planning
Constraints Satisfaction Problem
Graph planning
Local Search and Swarm intelligence
Minimax
open questions
SEARCHING FOR SOLUTIONS
Tablut Challenge
考试准备
M2
exams
First Order Logic
prolog
intro_language_for_ai
exams
Notes
statics_mathematics
Floating-Point Representation
oral exam
Probability and Distributions
SGD
练习题
练习题笔记
course info
图书馆
学校标识
随笔
我为什么要读书
life
cooking
土豆丝炒肉
牛肚炒面
猪肉
疙瘩汤
皮蛋瘦肉粥
米布丁
红烧排骨
菠萝咕噜肉
蒸米饭
蜜汁烤肉
醪糟鸡蛋汤
travel
202512柏林布拉格维也纳
布拉格
柏林
欧洲旅行
维也纳
note_templates
菜谱_template
technology
others
discourse
gource
HACSonNAS
hdf5
HTC Vive
linux_related
router_proxy
softwares
tools
trimesh
Ubuntu
WebXR
programming_tools
alpine
docker
git
Tmux
versioning
python
logging
packaging
pybind11
sharedmemory
uv
robotics
apriltag
camera
dex_retargeting
Dual UR 5
franka
grasp pose
human pose estimation
humanoid_concepts
KUKA
manipulation
Omniverse
PickandPlace
pinocchio
pose estimation
Robot System
rotation
transformation
whole body control
机器人有关国标文件
ros2
foxy_issue
tricks
nvidia
Open Source
ruby
web model viewer
tools
Color Picker
cubic
Obsidian
Zotero

Select a result to preview

Enter to select
to navigate
ESC to close
#python
  • cpp与py https://github.com/TzeLun/CPP-Python_SharedMemory/tree/main
  • resource tracker https://github.com/python/cpython/issues/82300
    • <3.13 临时方案: https://github.com/python/cpython/issues/82300#issuecomment-2169035092
      import sys
      import threading
      from multiprocessing import resource_tracker as _mprt
      from multiprocessing import shared_memory as _mpshm
      
      
      if sys.version_info >= (3, 13):
          SharedMemory = _mpshm.SharedMemory
      else:
          class SharedMemory(_mpshm.SharedMemory):
              __lock = threading.Lock()
      
              def __init__(
                  self, name: str | None = None, create: bool = False,
                  size: int = 0, *, track: bool = True
              ) -> None:
                  self._track = track
      
                  # if tracking, normal init will suffice
                  if track:
                      return super().__init__(name=name, create=create, size=size)
      
                  # lock so that other threads don't attempt to use the
                  # register function during this time
                  with self.__lock:
                      # temporarily disable registration during initialization
                      orig_register = _mprt.register
                      _mprt.register = self.__tmp_register
      
                      # initialize; ensure original register function is
                      # re-instated
                      try:
                          super().__init__(name=name, create=create, size=size)
                      finally:
                          _mprt.register = orig_register
      
              @staticmethod
              def __tmp_register(*args, **kwargs) -> None:
                  return
      
              def unlink(self) -> None:
                  if _mpshm._USE_POSIX and self._name:
                      _mpshm._posixshmem.shm_unlink(self._name)
                      if self._track:
                          _mprt.unregister(self._name, "shared_memory")
      
  • cpp shm_open https://www.man7.org/linux/man-pages/man3/shm_open.3.html
Connected Pages
Pages mentioning this page
No other pages mentions this page