First thing from the command line I execute that function and can see from the usual q startup notifications it works. I can also see the processes have started. After that, I open KDB Developer.
In Developer I then capture the processes as follows:
// capture the other processes. {($".procs.h.",(string x[0])) set hopen x[1]} each flip (tomdericjanenessie;("J"$("20001";"20002";"20003";"20004"))); // assign process names to each of the processes as self. {(neg .procs[h][x[0]])x[1];(neg .procs[h][x[0]]);} each flip (tomdericjanenessie; raze each "self set ",/:string tomdericjanenessie); // assign 3 processes to peach. .z.pd: u#.procs.h[`tom`deric`jane]
Sometimes it seems like this works until I change developer window, alter a file and save. I don’t know if that just coincidence though.
Keen to hear if anyone can see any obvious schoolboy errors.
I’m reverting with feedback shared by our internal pros. Kudos to Benjamin Jeffery here!
There appears to be two identifiable issues:
Analyst was not designed to work with .z.pd. As these secondary processes don’t have internal Analyst functions or other state defined, behaviour when using .z.pd is undefined. This limitation will be added to the documentation for the next Analyst release.
The handle to the secondary process is closing whenever peach is called with a locked function. An internal ticket has been raised acknowledging this.
Hope this helps. Thanks again for sharing with the community
Thanks Leah. Good to know - so best practice if you are going to use peach with Developer/Analyst is to use the standard threaded approach (starting q with -s set to a positive integer denoting the number of secondary threads used in Peach. Then if I need an additional secondary process, I can just use standard IPC.
Alternatively, if I really want to use .z.pd, which (if any) of the following might you think worthwhile:
I try using the KDB dashboard to run previously defined functions?
I try using JupyterQ and running processes from a Jupyter notebook written in Q
Really appreciate your having a look and answering this. Let me know if I’m not right about anything above, otherwise I’m happy and have marked this issue as resolved.