shared shmem python

Solutions on MaxInterview for shared shmem python by the best coders in the world

showing results for - "shared shmem python"
Marie
30 Jan 2019
1>>> from multiprocessing.managers import SharedMemoryManager
2>>> smm = SharedMemoryManager()
3>>> smm.start()  # Start the process that manages the shared memory blocks
4>>> sl = smm.ShareableList(range(4))
5>>> sl
6ShareableList([0, 1, 2, 3], name='psm_6572_7512')
7>>> raw_shm = smm.SharedMemory(size=128)
8>>> another_sl = smm.ShareableList('alpha')
9>>> another_sl
10ShareableList(['a', 'l', 'p', 'h', 'a'], name='psm_6572_12221')
11>>> smm.shutdown()  # Calls unlink() on sl, raw_shm, and another_sl
12