Universal Robots Forum

Thread safety in URScripts

Hello all!

In my scripts, I have threads that perform communications with an external device using a socket: one of them reads data and writes some variables, and another one sends data according to some variables.

The one that sends data is using socket_send_int ~10 times in a row inside a critical section. The script manual says critical sections cannot be interrupted, so I’d assume that all the ints are transferred one after the other without interruptions.
My question is: what happens if all those transmissions take more time than the assigned frame time for that thread? Will it be interrupted or not?

You will get runtime exception and program will stop.