Parallel execution

  Hello all,

  I am wondering if Multithreaded Input Mode option is designed to allow the parallel execution of different requests.  I start a long-running request, and would like to submit short-running requests in parallel, however after the long-running request starts, I am not able to submit to the server any other requests in parallel.  My function calls are implemented in a loaded C library.

  Thanks

You should be able to open second connection from different thread and send request in parallel. Don’t forget to clean up ( r0 all k created and received in the thread and call m9() )  before thread end, otherwise tls will leak

Cheers,
Oleg

new connections are accepted by the main thread,
which runs when no other threads are currently executing a query.

So in this mode, open your connections early, and re-use them.

So in other words, the query execution is still single-threaded even for select only queries?  The doc http://code.kx.com/wiki/Cookbook/MultithreadedInputMode seems to indicate the select queries can be run concurrently, and it’s up to the users to ensure there is no mutation. 

no. In this mode queries run concurrently, each in their own thread.
It is the accepting of new connections that requires currently executing queries to complete first. You can re-use a connection run another query.

These queries cannot change global data - it will throw an error to that thread if it tries.

The main thread can change globals. There’s a MWSR lock so all queries can run in read mode, but for the main thread to run, it must obtain the write lock.