implement P and V in server