adding shared memory version of dual difference