Is it save to write to the same sym file by 2 or more q processes currently

https://learninghub.kx.com/forums/topic/is-it-save-to-write-to-the-same-sym-file-by-2-or-more-q-processes-currently

Hello,

I have a concern when 2 or more q processes a writing/updating the enumeration in a single sym file by .Q.en[] or '://sym?newsymbols concurrently. Do these operations are multi-process safe? I am a little confused in the documentation:

The file is locked at a process level for writing during .Q.en only. Avoid reading from any file which may be being written to.

The system call used is https://linux.die.net/man/3/lockf.


Does this means that only .Q.en[] is performing the locking?

(Referring to the documentation) '://sym?newsymbols should also uses the file lock, is this correct?


Thank you very much.


Jacky


.Q.en uses ?. It is ? that does the locking. So both at the same time is fine.


See:

https://code.kx.com/q/ref/enum-extend/#filepath



Thanks so much?