P1:
Wait(Sx); Wait(Sy);
Do something;
Signal(Sx); Signal(Sy);
P2:
Wait(Sx); Wait(Sy);
Do something;
Signal(Sy); Signal(Sx); .
Assuming initial value of semaphore: sx =1 and sy = 1, otherwise no process will execute.
Starvation is possible in both the process. Because if one process starts it can continue to execute again and again.