Set up shared memory.