users@grizzly.java.net

How can my application benefit from non-blocking http server like Grizzly?

From: Ken--_at_newsgroupstats.hk <dragonken_at_gmail.com>
Date: Tue, 23 Sep 2008 09:21:19 -0700 (PDT)

In real situation, a thread for serving web request may be blocked (or
time-waiting?) by something like waiting db enquiry result or waiting remote
process to response (like rmi?). In non-blocking http server like Grizzly,
will the blocked thread be availabled for other web request(s)?

The stress test result (pages / second) for the following JSP in Glassfish
V2 is the same as Tomcat
<!--test_sleep.jsp-->
<%Thread.sleep(100L);%>
<!--end test_sleep.jsp-->

How about this one?
<!--test_block.jsp-->
<%
ArrayBlockingQueue<Result> arrayBlockingQueue = new ArrayBlockingQueue(1);

//ask for result, the result will be stored in the queue by another thread
RemoteProcess.askForResult(arrayBlockingQueue);

Result result = null;
try {
// waiting result for 10 seconds, the thread for running this request will
be blocked up to 10 seconds
result = arrayBlockingQueue.poll(10, TimeUnit.SECOND);
} catch (Exception e) {
}
if (result == null) System.out.println("Time out...");
%>
<!--end test_block.jsp-->

How to write my web application so that I can fully make use your thread
pool? Hope you understand my question.

Regards,
Ken




-- 
View this message in context: http://www.nabble.com/How-can-my-application-benefit-from-non-blocking-http-server-like-Grizzly--tp19631411p19631411.html
Sent from the Grizzly - Users mailing list archive at Nabble.com.