RobotStudio event

Built-in controller in EGM mode and implementing custom regulators (IRB 1600).

Hello everyone! I wanted to clarify a few question about the built-in controller algorithms in order to implement EGM properly and develop my own regulators for particular tasks. I'd be grateful for any help. 
1. What kind of regulator (if any) is used when running EGM? Is it an open or closed loop control? Is this regulator different from the regulator, which used when the robot runs a simple RAPID program (MoveL, MoveJ, etc.). This information is important to me, because I want to write my own regulators in C++ code using feedback from the robot, but I'm not sure how they are going to interact with the default one.
2. The following formula mentioned in the "Application manual. Externally Guided Motion.", and I don't fully understand the parameters.
speed = k*(pos_ref - pos) + speed_ref
speed: Is it the speed of a single joint or the TCP?
pos_ref: What does "reference position" exactly mean?
pos:  This parameter is called as "desired position" in the manual, what's the difference with pos_ref ?
speed_ref: The meaning of this parameter is also not clear to me.
2. In the EGM mode it's possible to send to the robot either coordinates or velocities. It seems that aforementioned formula applies to the case of sending coordinates. What kind of formula will be used when the sensor sends joint velocities? My guess is that we should use zero position gain (k=0), and this way velocities can be send.
3. How it is crucial to use Linux for UDP server, or Windows will do just fine? The problem I'm concerned with is that Windows is not a real time system, and there might be lags.