elecharny commented on PR #77:
URL: https://github.com/apache/mina/pull/77#issuecomment-6074259575

   > > 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.
   
   The mWriteQueue.
   
   > 
   > 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.
   
   Totally agree on this. My concern is for this specific test that 
demonstrates the issue: we have one connector sending a big message to one 
acceptor, and wait for the response. And still, we have two threads messing 
with the queue, which I don't understand.
   
   > 
   > 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.
   
   
   Agreed.
   


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