stevedlawrence opened a new pull request #748:
URL: https://github.com/apache/daffodil/pull/748


   Three changes are made to how alignment works:
   
   1. When statically determining if alignment is needed or not, we
      previously did not implement prefixed length elements and just
      assumed no alignment information. This prevented optimizations when
      prefixed elements existed. This implements the approximate length of
      prefixed elements to be a multiple of their lengthUnits, which should
      allow many alignment parsers/unparsers to optimize out and avoid
      deadlocks.
   
   2. When asking about the alignment of prior elements (e.g. parents,
      previous siblings) we can sometimes get an answer of no information.
      This most commonly happens when asking about the prior alignment of
      model group that is the first child in a global declaration. In these
      cases, we do not know how or where the global declaration will be
      referenced, and so it could have any alignment. And because the
      alignment algorithm only looks at lexical scope, it cannot make any
      decisions based on those references. So, in this kinds of cases where
      we have no information about prior alignment, we must assume we have
      no information. This means we will now have some alignment
      parsers/unparsers that we simply cannot optimize out, but this also
      means we fix a bug where there was required alignment that was
      incorrectly optimized out because it assumed known alignment.
   
   3. Be less pessimistic about assigning lengths of the
      SimpleTypeRetryUnparser. This unparser previously assumed no length
      information about the suspension, which meant that we lost bit
      position information about suspensions and the locations of buffered
      data output streams. This could lead to AlignmentFillUnparsers
      getting deadlocked. This changes the logic so that when we can
      statically determine that there will be no padding/fill bytes/etc.
      and that the actual unparsed length will be exactly the same as the
      target unparse length, then we can use that length and give more
      information to the DataOutputStreams to avoid deadlocks.
   
   DAFFODIL-2626


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to