how can q assign incoming requests to slave threads ?

After a request hits .z.pg , how can it pass it to a “slave” thread while the “main” thread can service subsequent requests ?

Hi,

I would recommend using a gateway.

You can find a general introduction to kdb+ gateways in
http://code.kx.com/pages/db/DB_Common_Design_Principles_for_kdb+_Gateways.pdf

and a more detailed explanation of how to use a gateway to serve multiple user requests in

http://code.kx.com/pages/db/DB_Query_Routing_a_kdb%2B_Framework_for_a_Scalable_Load_Balanced_System.pdf


Regards,

Davide Corti | KDB+ Engineer | Kx | +44-7926-223284 | dcorti@kx.com

I know you can use a gateway but I would like to know the thread version of the answer.

Launch q with negative port number, that way incoming requests will be served in slave threads (with the usual limitations of what you cannot do in slave threads).

Cheers,

Oleg

Whats the usual limitation on slave threads ?

'noupdate mostly
No updating global variables, no using hopen, no OS operations, used to be some version when no #g setting was allowed, but they then fixed it. No using network handles, I’m afraid (unless they changed it recently).

You can, although, use one-shot `connsymbol"query" but it’s kind of defeats the purpose.

So… A bit useless, but you can serve selects on hdb,I suppose.

Cheers,

Oleg