is there a way to register for processes state changes from userspace ?