as per i know these 2 problemss i guess here.
In order to detect a loop in a topology
This is more to with Physical loop in the toplogy, spanning tree can be helpfull to detect the loops.
how does the MAC address thrashing
as per i know this one only be helfull if you have duplicate MAC address in the switch or learning from L2 domain.