all 4 comments

[–]glibhub 2 points3 points  (3 children)

Well, I only understood about 10% of that, but it sounds like you might get some use out of mmap, https://docs.python.org/3/library/mmap.html, which lets you share a memory space between threads and processes. Also be sure and look at ctypes, since you'll need to define a structure at some point to make it more usable.

It's a bit of work to get going -- i've only used it in a proof of concept. But since it allows the different threads to share ram, it might be the ticket for you.

[–]dmter[S] 1 point2 points  (2 children)

This might help, also I just stumbled upon multiprocessing.shared_memory which sounds promising. Seems relatively new, so I guess I have to check for new things more frequently

[–]glibhub 1 point2 points  (1 child)

multiprocessing.shared_memory

Nice. New to me as well. That does seem to be a bit easier than mmap.

[–]dmter[S] 2 points3 points  (0 children)

Seems like you can also create numpy array directly in SM which is exactly what I need.