complete version of sort-segscan ms in shared mem