Is there a way in KDB/Q to delegate user request to a separate thread? In my server, I have an internal calculation loop that runs at frequent intervals and takes time to finish. While it is running, all user queries are blocked.
How do I delegate calculation to an entirely separate thread? The only way to achieve multithreading I see is using peach/.Q.fc but that doesn't help in this case as I want to process user requests and internal loop in parallel.
It sounds to me like you're using a process as a kind of hub here, both as a gateway and an analytics engine - I would suggest sending the internal loop out to a separate process with an asynchronous call and having it in turn asynchronously update anything that you need updated by it back on the main thread, although knowing more about the nature of the loop would be helpful in order to pre-identify any problems with doing so.
See here for more information on IPC in general.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With