KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ C API, calling k within a thread Re: C API, calling k within a thread

  • jlucid

    Member
    July 26, 2023 at 12:00 am

    Ok thanks, so to clarify, we are not calling k from a q process, via a shared library. We are running a C++ process where different threads are responsible for publishing data to different q processes using the k function. The threads are created using std::thread. Before the threads are created, the handles to the different q processes are opened and then subsequently passed to the threads to use during the async publish.

    This has been working well for us so far, in that data is being received by the q processes, and we can see that m4 (which returns the memory for the current thread) is showing no memory leaks. Are you saying there could be a danger with this setup?

    We have been looking at the API reference doc, but it doesn’t mention this restriction in regards to k, see https://code.kx.com/q/interfaces/capiref/#k-evaluate. Please let us know if there is another reference we should be using.