Class EolContextParallel

  • All Implemented Interfaces:
    IEolContextParallel, IEolContext
    Direct Known Subclasses:
    ErlContextParallel, EwlContextParallel

    public class EolContextParallel
    extends EolContext
    implements IEolContextParallel
    Skeletal implementation of a parallel IEolContext. This class takes care of the common structures which are affected by multi-threading using ThreadLocals. For use cases where these thread-local values are required, a PersistentThreadLocal is used, so that the context will be consistent with a sequential implementation once #endParallel() is invoked.

    For optimal performance, it is recommend that parallel tasks obtain a sequential "snapshot" of this context to avoid frequent retrieval of ThreadLocal values using the getShadow() method.
    Sina Madani
    • Constructor Detail

      • EolContextParallel

        public EolContextParallel()
      • EolContextParallel

        public EolContextParallel​(int parallelism)
        parallelism - The number of threads to use.
      • EolContextParallel

        protected EolContextParallel​(IEolContext other)
        Copy constructor.
        other - The parent context to copy from. Must not be null.