directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wes McKean <>
Subject Re: Serverside NIO: Not ready for Prime Time
Date Thu, 27 Nov 2003 17:53:52 GMT
> I would continue to work with SUN to solve the reading in a separate
> thread thing.  It should be fixed.  However down the road in a beta
> release stage we can optimize the server and determine if consolidation
> certain stages is worth while.  You need statistics and a population of
> clients to determine the net effect in a SEDA based design whether
> stage consolidation really pays off.  Thoughts?

Other than what I already mentioned.  The ASN.1 stuff accepts an InputStream, 
which is by nature blocking.  We do not have access to the SNACC code to 
change this.

So to fix this, I basically had to catch the READ event and read the 
transaction in the InputManager, then pass a new ByteBufferInputStream off to 
the decoder.  Now the trick is that if the READ only processed a partial 
transaction, then the rest of the transaction is going to come into the 
InputManager thread while the Decoder thread is decoding the transaction.  So 
the InputManager thread has to look up the ByteBufferInputStream and append 
the new ByteBuffer while Decoder is decoding.  This is a hack in the classic 
sense of the word.

If the InputManager could determine that it had read a complete transaction, 
then pass it off to the decoder, I would gladly admit that that solution is 
as elegant as processing the READ event in one thread and reading and 
processing in another.

The good news is that for now, the hack works and will satisfy our needs until 
either the bug is addressed, or we are able to come up with a more elegant 
solution.  The hack is probably even worthy of a production environment.

I'll upload the new code to the sandbox and we'll just take it from there.


View raw message