|Parallel Serialization [message #1833941]
||Wed, 28 October 2020 14:40
| L R
Registered: July 2019
Our project is translating from one Xtext grammar to another. As part of this translation, we perform a many to many translation as one single operation. We have found that the serialization takes a long time to process. To improve this, we were considering performing serialization in parallel. Unfortunately, we have been seeing various exceptions in the serialization that we attribute to parallel operation.|
We found the recent blog post: https://blogs.itemis.com/en/how-the-code-generation-process-in-xtext-can-be-executed-parallely. This post was regarding code generation execution in parallel. This included mentioning that EMF is not thread-safe and to take special care regarding proxy resolution.
We also found a couple of old open issues related to this topic:
The recommendation at the end of 203 was to run a static initialization in a single thread before running the actual serialization. While the recommendation at the end of 906 was to create a custom GrammarProvider and install the adapters upfront.
In our scenario, we generated the ASTs serially and the resulting grammar does not have proxy elements. Each AST has its own Resource, but they all share the same injected ResourceSet. However, even after running an initial serialization serially, we occasionally still receive a serialization exception. Is there guidance on how much serialization needs to be performed by the static initialization?
I have prototyped a custom GrammarProvider, similar to the 906 solution, but haven't tried it enough to see if it resolves this issue.
Overall, is there guidance on how to safely perform serialization in parallel?
Powered by FUDForum
. Page generated in 0.01994 seconds