tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rémy Maucherat <r...@apache.org>
Subject Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener
Date Wed, 19 Mar 2014 17:04:36 GMT
2014-03-19 17:47 GMT+01:00 Yann Simon <yann.simon.fr@gmail.com>:

> > This is because you're forking a thread, it won't concurrently invoke the
> > two events (which would be invalid).
>
> Can you explain more please? I have difficulties to understand your
> sentence.
>

It means the container has to wait until onReadPossible completes to call
onDataAvailable.

>
> >> I'd wish the specs to be much more precise for this sort of behavior,
> >> because it is now quite impossible to write a ReadListener that can
> >> run both on Jetty and Tomcat for example.
> >>
> >
> > Other async APIs like NIO2 are not any more "precise" on purpose about
> the
> > threading model, because this allows being flexible and have better
> > performance. You could use a semaphore to implement your desired
> behavior.
>
> Thx for the hint, I'll try that. But I doubt to find a solution that
> works on all containers.
>

I don't see how it could do worse than straight syncing.

Rémy

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message