Updated shared memory implementation