the problem with mach threading is its handled in the pc. the pc can be interupted by anything else - so can never be real time.
i tried every combination to get succesful threading- but it wasnt repeatable enough. - ie if 1 pass out of 100 fails to sync properly- the tool is broken and the thread ruined.
( i even updated my boxford with mitsubishi servos- so it could respond much faster than a stepper.
the only way ive found to get a thread right is to follow an encoder. - direct into a motion controller.
heres an example of it in its simplest form. running via a uc300 eth motion controller. - encoder is 2 optos reading the pulse wheel.
https://www.youtube.com/watch?v=GnDHt4IQdpo