On 11/30/2014 02:31 PM, Georg Baum wrote:
Anyway, I id some experiments with different solutions:

forcecopy.diff shows how a solution with a small helper function looks like.
This is quite simply, but it requires to manually use it in all places where
strings could be copied in multiple threads. Not nice, but I think it is
doable.

stringclass.diff shows an incomplete solution with an own string class. I
used docstring (this would be needed for std::string as well), since a
replacement of std::string would produce a huge diff. The advantage is that
you do not need to think about using a deep copy or not, but the
disadvantage is that you need to duplicate a lot of base class
functionality, and it produces warnings about ambigous operator+ (but
without these ambiguities, other parts of the code don't compile).

I did not try Jean-Marcs suggestion about de-parallelizing the export and
only calling the external tools in parallel. I am pretty sure that it works,
however if we go this way then we basically say that we don't want parallel
code in LyX itself. Despite I like the idea very much I am not so sure
whether we should go this way, since the processor trend goes towards more
cores and more energy efficency (which often means lower clock frequency),
so we might need to use parallelism even more in the future.

Currently I prefer the deep_copy() method: The own string class which I
initially liked more has too many side effects, then we can as well use a
small helper which is better to understand. What do others think? How should
we proceed?

This is way beyond what I understand, so I shall abstain from commenting.

Richard

Reply via email to