KX Community

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

Home Forums PyKX PyKX IPC work with multithreading? Re: PyKX IPC work with multithreading?

  • rocuinneagain

    Member
    June 1, 2023 at 12:00 am

    The issue you are having is unrelated to peach/multithreading on the kdb+ side.

     

    The issue is the reuse of the same connection among @task blocks.

    The different @tasks are attempting to read data from the same connection concurrently leading to junk data being passed through.

     

    kdb+ processes incoming queries sequentially. This means even through you see the log messages from the tasks as if they run in parallel in fact once these arrive to kdb+ they will be processed one after the other always. For this reason switching to @flow will not be slower and will result is safe consistent results.