Sharing a large (read-only) binary string between Python processes?

Viewed 1694

I have a large, read-only bytes object that I need to operate against across several different Python (3) processes, with each one "returning" (adding to a result queue) a list of results based on their work.

Since this object is very large and read-only, I'd like to avoid copying it into the address space of each worker process. The research I've done suggests that shared memory is the right way to go about this, but I couldn't find a good resource/example of how exactly to do this with the multiprocessing module.

Thanks in advance.

1 Answers
Related