I'm
very rusty in that I haven't screwcut anything or turned a lathe on for about fifteen years or so but ultimately the process is the same whatever your turning. In very basic terms, and because I can't remember all the correct names/words for the process any more;
You set the lathe cutting and travel speed for the type and diameter of metal being cut, zero the gauges using micrometers after initially measuring, and turn the material down to the outer diameter for the thread being cut and just shy of the length of thread required (I used to have a cutting booklet with all the diameters/pitches etc).
Change tools to a chamfer (I think, it has been a long time) and cut a chamfer at the end where the thread will finish to the inner diameter of the thread (the end opposite to the crown), at the length required, this will be determined by the moderator and will be measured with a gauge.
Change tools to the thread cutting tool with the correct pitch etc, the lathe is then turned down to a pretty slow speed and the thread cut and pitch settings engaged for the travel of the saddle (it might be wrong name or it is coming back to me!).
You then cut the thread in several passes checking with a thread gauge and laterally the mod as you go as once material has been taken off it don't go back on. If you cut too fast or deep the finish is gash.
The crown shouldn't require to be re-done but I'm not a gunsmith and they can probably knock holes in what I've written
!
The barrel may also be set up to cut on a running centre to alleviate vibration etc due to the length of the barrel and whether the action is attached.
I may have missed something as it has been a long time but that is ultimately it. The reason for different threads is vast; metric, imperial, bsp, bsf, square etc etc.