Shared Data Management for Multhreaded Parallel Applications on CMPs