Yes, they are segregated in most prisons. There are some cases where that isn't possible but the administration understands the dynamic and does everything in their power to ensure the safety of all inmates.