The first emphasized quote (“in parallel”) contradicts the second one (“They run with common profile”). Exactly because to make several LibreOffice processes run in parallel, you must use different profiles. It’s not the command line parameter "-env:UserInstallation"
does some magic; it is the user profile directory defines a unique identifier, and all LibreOffice instances try to find an already started instance using the same profile; if they find one, they pass their workload to that first process, wait for it to be processed there, and exit (so when you use the same user profile, either implicitly - without any command line switch - or explicitly, you don’t get a parallel processing).
Now if you are using the same profile, and you try to run processes in parallel (i.e., several processes using that same profile are started with their --convert-to
switches, running several at the same moment, as opposed to a script that starts the next task after the previous ended), then the following might - and definitely sometimes will - happen:
- Process a starts, with its conversion defined by its
--convert-to
switch
- Process a defines a system pipe with the name based on the profile path, so that following processes can discover it
- Process a starts doing its task
- Process b starts, with its different conversion defined by its
--convert-to
switch
- Process b tries to open the pipe based on the profile path; that succeeds
- Process a ends processing its work
- Process b sends its command line to process a
- Process a exits, because its
--convert-to
is a “do its job, then exit” kind of command.
When you use the same profile, you must use a single always-running instance (started without a --convert-to
parameter), and then all instances that you later start with --convert-to
will send their jobs to that central not-exiting instance. Not only that will be safe; it will also work much faster, because there will be no startup/shutdown penalty that you pay per each process (note that majority of that penalty happens not because of OS starting a process, but because LibreOffice initializes / deinitializes itself).
When you run several parallel jobs, you must use different profiles. But then you may use a poor strategy of several scripts, each handling part of the whole list of files, using its profile, and calling LibreOffice for the files one by one (this will have the same startup/shutdown penalty); or you may again start several instances (one per profile) first, without --convert-to
, and then call --convert-to
instances that will sent their command lines to those parallel permanent instances. Or - you may build several huge command lines, each listing all the files that each instance must process, and then start separate parallel tasks, each with its own huge command line. That way, they will start once, process all their files, and shutdown, without a fear that some other process will try to interfere.