jon-valliere commented on PR #77:
URL: https://github.com/apache/mina/pull/77#issuecomment-6063386991

   > Hi Jon, long time no see ;-)
   > 
   > I buy what Claude says.
   > 
   > Still I'm having hard time understanding how 2 different threads could 
concurrently access the same queue when each thread uses a different SslHandler 
instance, each one with its own instance of a queue, so there is no way one 
queue can be shared between those two threads...
   
   Which queue are you referring to?  The queues are per connection/socket.
   
   Going off memory here...
   
   In HTTP/2 for example, the chunking + virtual channel mechanism could span 
multiple async requests in parallel on different threads with each thread 
submitting chunks/files into writer pipeline for a single socket.  Mina does 
not guarantee any kind of ordering on the write pipeline and leaves it entirely 
up to your own implementation.
   
   The synchronized monitors around the queues are necessary not because the 
queue is unsafe but because the pipeline function of polling from the queue and 
pushing into the connection/socket needs to be synchronized.  To prevent write 
corruption, the order encrypted messages are pulled from the queue and written 
to the socket must be guaranteed.
   
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to