I'm trying to understand threading as it has do to with creating a service in XDATA. If I create an XDATA server using the default services of "EchoString" and "Sum". Is the function "Sum" already in a thread, or do I need to create my own threads from inside that function? Are these functions already thread-safe so multiple xdata connections can call them at the same time?
Yes, for service operations, it's XData which creates the threads and already call the services in threads. All you have to do is to implement your code, having in mind it's running in a thread and multiple executions might be happening.
Actually next Wednesday (June 2nd), there will be a free Webinar titled ("Cloud Services with Delphi: Don’t Make These Mistakes") where I explain some XData concepts, including exactly that one. You can register for it here: TMS Software | TMS Web Academy