I've lived with about 70 people in 4 countries not including that long stay in a Dublin hostel
nor that month in a men's shelter in Berkeley, California.
I wish I could give some good advice.
Once, I lived in a place where my housemates had to keep coming to my door,
asking me to reboot a crappy wireless router that was in my bedroom.
After talking with some friends, I decided what to do.
I bought some lengths of network cable and I drilled the necessary holes in wall and floor.
I hard-wired everybody's room and I asked them not to come knocking on my door. At the time, it was a little bit hurtful for the woman housemate, I think; but she got over it quickly enough.
... and that's been my preference to this day.
Right now, at this moment, that's what I want for nobody to come knocking on my bedroom door.
I've been working for years to develop a universal protocol that would balance find-my-own-space with don't-be-a-prick.
I wish I had some good advice.