[Cosmo-dev] Tomcat 6 Benchmarks
br at osafoundation.org
Wed Mar 14 10:11:58 PST 2007
I agree. But it's not necessarily the job of the container to take
away that pain. Programming with servlets and JSP's is "painful" but
other people came up with stuff like JSF, Struts, Spring MVC,
etcetera ad nauseum. So while the Tomcat folks might come up with
some nicer abstractions, I think we're more likely to see frameworks
built up around the CometProcessor in other projects which provide
these nice API's.
However as far as I can tell, programming using this model will
always be a bit more complicated than what we're used to. In the
thread-per-request model we're used to, it's perfectly fine to wait
for blocking calls (say a database query) to come back in your thread
because you know you're not affecting anyone else. But in the async
model any time you want to do anything that takes a non-deterministic
or "long" amount of time you have to instead throw it on another
thread and give it a callback and return immediately.
I am sure that you can simplify this process to a degree but in this
model you will never see code that looks like this:
//calls the db down the chain...
User user = service.getUser(id);
//now do stuff with user
Instead might look more like this:
Deferred deferred = service.getUser(id);
I cannot see anyway around having your execution flow broke up all
over the place. Any Twisted geniuses have any insight into this?
On Mar 14, 2007, at 9:09 AM, Brian Moseley wrote:
> On 3/14/07, Bobby Rullo <br at osafoundation.org> wrote:
>> Seeing NIO made me immediately think of Comet and low and behold
> this programming model seems a little too complex. i hope that over
> time it will be simplified. concurrency is hard, but i feel like the
> container should be able to take away a little more of the pain.
> cosmo-dev mailing list
> cosmo-dev at lists.osafoundation.org
More information about the cosmo-dev