On Sun, 9 Jun 2019, Markus Elfring wrote: > Hello, > > The Coccinelle software supports also a variant of parallel data processing > after the parameter “--jobs” was passed. > https://github.com/coccinelle/coccinelle/blob/7ec31ed1fadf738bc487ccefdc63bfe0598f44cc/docs/manual/spatch_options.tex#L745 > > It is nice when it works to distribute analysis on source files to some processors. > Unfortunately, undesirable software behaviour can be observed if a database > like “PostgreSQL 11.3-7.1” would be used in such a system configuration. > Thus I imagine that it can be occasionally appropriate to perform desired > parallel data processing by the usage of a detailed pipeline instead. > https://ocaml.github.io/ocamlunix/pipes.html > > How do you think about another application for this kind of > inter-process communication? When you use -j, you fork processes that thus the child processes write to a different region of memory than the parent process. I don't have any interest in connecting Coccinelle to a database, so I'm not going to spend any time on debugging your issue. However, if you want to look into it, this may be the source of the problem. Maybe you can use a hashtable, then use merge in a finalize, and the write the information to the database in the parent thread. The use of merge is illustrated in eg tests/merge_vars.cocci julia