As you mentioned that there is THREAD WORMS INFESTATION and it is coincidence that these worms bother you at the time of menstrual cycle.
However , you didn't mention the type of treatment , which you have taken.
Thread worm i.e. enterobius
( oxyuris) vermicularis , usually respond to these drugs , these include.
1 Pyrantel pamoate
10 mg /kg body weight in a single dose.
100 mg single dose , repeated after 2-3 weeks ( to kill the ova that have developed later ).
Strict hygienic measures and simultaneous treatment of all children in the family or class is advocated to cut down autoinfection and person to person contac
This holds true of enterobiasis , irrespective of drug used.
400 mg in single dose .
Hope ,if you will deal as mentioned above , you will get permanent solution of your problem.