[jetty-dev] Is jetty multithreaded

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[jetty-dev] Is jetty multithreaded

Christian Wolfgang
Hi.

I have a servlet that initiates some work with a post request and with
a get request I can get its status. But when I try to get its status,
the request is first processed when the post request is done.
But if i break up the post request in bits, with Thread.sleep(), the
get request can be processed.

I thought jetty was multithreaded? Am I wrong or am I doing something wrong?

Thanks.

Christian
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Is jetty multithreaded

Jesse McConnell
see: http://wiki.eclipse.org/Jetty/Feature/Continuations or servlet
3.0 for async servlets

what your running into is that once a request enters into the servlet
api, it has a thread allocated to it for its lifetime in the
servlet-api prior to servlet 3.0 where the concept of async was
supported.  continuations is a mechanism that allows for a similar
mechanic on jetty in servlet 2.5

and yes, jetty is multithreaded

cheers,
jesse

--
jesse mcconnell
[hidden email]



On Mon, Feb 6, 2012 at 08:47, Christian Wolfgang <[hidden email]> wrote:

> Hi.
>
> I have a servlet that initiates some work with a post request and with
> a get request I can get its status. But when I try to get its status,
> the request is first processed when the post request is done.
> But if i break up the post request in bits, with Thread.sleep(), the
> get request can be processed.
>
> I thought jetty was multithreaded? Am I wrong or am I doing something wrong?
>
> Thanks.
>
> Christian
> _______________________________________________
> jetty-dev mailing list
> [hidden email]
> https://dev.eclipse.org/mailman/listinfo/jetty-dev
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Is jetty multithreaded

Christian Wolfgang
Thank you for the fast answer.

I'm not sure if I understand it correctly. I am not interested in
suspending any of the requests.
I want to keep on processing my post request and asynchronously get
status checks on its process.

Should I dispatch the post request processing in another thread, so
that other request could get access?

Thanks.


Christian

On Mon, Feb 6, 2012 at 16:22, Jesse McConnell <[hidden email]> wrote:

> see: http://wiki.eclipse.org/Jetty/Feature/Continuations or servlet
> 3.0 for async servlets
>
> what your running into is that once a request enters into the servlet
> api, it has a thread allocated to it for its lifetime in the
> servlet-api prior to servlet 3.0 where the concept of async was
> supported.  continuations is a mechanism that allows for a similar
> mechanic on jetty in servlet 2.5
>
> and yes, jetty is multithreaded
>
> cheers,
> jesse
>
> --
> jesse mcconnell
> [hidden email]
>
>
>
> On Mon, Feb 6, 2012 at 08:47, Christian Wolfgang <[hidden email]> wrote:
>> Hi.
>>
>> I have a servlet that initiates some work with a post request and with
>> a get request I can get its status. But when I try to get its status,
>> the request is first processed when the post request is done.
>> But if i break up the post request in bits, with Thread.sleep(), the
>> get request can be processed.
>>
>> I thought jetty was multithreaded? Am I wrong or am I doing something wrong?
>>
>> Thanks.
>>
>> Christian
>> _______________________________________________
>> jetty-dev mailing list
>> [hidden email]
>> https://dev.eclipse.org/mailman/listinfo/jetty-dev
> _______________________________________________
> jetty-dev mailing list
> [hidden email]
> https://dev.eclipse.org/mailman/listinfo/jetty-dev
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Is jetty multithreaded

kim young ill
dont think it's possible.
as i understand: for each new request comming in u'll get a new thread to process. if u want to maintain the state of that request, u have to put it somewhere where the other requests can acces (e.g session or even servletcontext)

u cannot access one request from another request.

 

On Mon, Feb 6, 2012 at 9:10 PM, Christian Wolfgang <[hidden email]> wrote:
Thank you for the fast answer.

I'm not sure if I understand it correctly. I am not interested in
suspending any of the requests.
I want to keep on processing my post request and asynchronously get
status checks on its process.

Should I dispatch the post request processing in another thread, so
that other request could get access?

Thanks.


Christian

On Mon, Feb 6, 2012 at 16:22, Jesse McConnell <[hidden email]> wrote:
> see: http://wiki.eclipse.org/Jetty/Feature/Continuations or servlet
> 3.0 for async servlets
>
> what your running into is that once a request enters into the servlet
> api, it has a thread allocated to it for its lifetime in the
> servlet-api prior to servlet 3.0 where the concept of async was
> supported.  continuations is a mechanism that allows for a similar
> mechanic on jetty in servlet 2.5
>
> and yes, jetty is multithreaded
>
> cheers,
> jesse
>
> --
> jesse mcconnell
> [hidden email]
>
>
>
> On Mon, Feb 6, 2012 at 08:47, Christian Wolfgang <[hidden email]> wrote:
>> Hi.
>>
>> I have a servlet that initiates some work with a post request and with
>> a get request I can get its status. But when I try to get its status,
>> the request is first processed when the post request is done.
>> But if i break up the post request in bits, with Thread.sleep(), the
>> get request can be processed.
>>
>> I thought jetty was multithreaded? Am I wrong or am I doing something wrong?
>>
>> Thanks.
>>
>> Christian
>> _______________________________________________
>> jetty-dev mailing list
>> [hidden email]
>> https://dev.eclipse.org/mailman/listinfo/jetty-dev
> _______________________________________________
> jetty-dev mailing list
> [hidden email]
> https://dev.eclipse.org/mailman/listinfo/jetty-dev
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev


_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Is jetty multithreaded

Christian Wolfgang
Sorry, I think I might have been a little sparse on the details.
The states from the post requests are stored in files and the get
requests reads of the files to get the status.

What I'm trying to do is:

protected void doPost( HttpServletRequest request, HttpServletResponse
response ) throws ServletException, IOException {
                AsyncContext aCtx = request.startAsync( request, response );
                Executor executor = Executors.newCachedThreadPool();
                executor.execute( new Calc( aCtx ) );
}

But the get request still waits?!

On Mon, Feb 6, 2012 at 22:30, kim young ill <[hidden email]> wrote:

> dont think it's possible.
> as i understand: for each new request comming in u'll get a new thread to
> process. if u want to maintain the state of that request, u have to put it
> somewhere where the other requests can acces (e.g session or even
> servletcontext)
>
> u cannot access one request from another request.
>
>
>
>
> On Mon, Feb 6, 2012 at 9:10 PM, Christian Wolfgang <[hidden email]> wrote:
>>
>> Thank you for the fast answer.
>>
>> I'm not sure if I understand it correctly. I am not interested in
>> suspending any of the requests.
>> I want to keep on processing my post request and asynchronously get
>> status checks on its process.
>>
>> Should I dispatch the post request processing in another thread, so
>> that other request could get access?
>>
>> Thanks.
>>
>>
>> Christian
>>
>> On Mon, Feb 6, 2012 at 16:22, Jesse McConnell <[hidden email]>
>> wrote:
>> > see: http://wiki.eclipse.org/Jetty/Feature/Continuations or servlet
>> > 3.0 for async servlets
>> >
>> > what your running into is that once a request enters into the servlet
>> > api, it has a thread allocated to it for its lifetime in the
>> > servlet-api prior to servlet 3.0 where the concept of async was
>> > supported.  continuations is a mechanism that allows for a similar
>> > mechanic on jetty in servlet 2.5
>> >
>> > and yes, jetty is multithreaded
>> >
>> > cheers,
>> > jesse
>> >
>> > --
>> > jesse mcconnell
>> > [hidden email]
>> >
>> >
>> >
>> > On Mon, Feb 6, 2012 at 08:47, Christian Wolfgang <[hidden email]> wrote:
>> >> Hi.
>> >>
>> >> I have a servlet that initiates some work with a post request and with
>> >> a get request I can get its status. But when I try to get its status,
>> >> the request is first processed when the post request is done.
>> >> But if i break up the post request in bits, with Thread.sleep(), the
>> >> get request can be processed.
>> >>
>> >> I thought jetty was multithreaded? Am I wrong or am I doing something
>> >> wrong?
>> >>
>> >> Thanks.
>> >>
>> >> Christian
>> >> _______________________________________________
>> >> jetty-dev mailing list
>> >> [hidden email]
>> >> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>> > _______________________________________________
>> > jetty-dev mailing list
>> > [hidden email]
>> > https://dev.eclipse.org/mailman/listinfo/jetty-dev
>> _______________________________________________
>> jetty-dev mailing list
>> [hidden email]
>> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>
>
>
> _______________________________________________
> jetty-dev mailing list
> [hidden email]
> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Is jetty multithreaded

Christian Wolfgang
Sorry, I think I just figured out my problem.
I was trying to get some data from a multi part form data not
realizing that the my process first began when the entire form was
uploaded, not when the request was received.

On Tue, Feb 7, 2012 at 08:44, Christian Wolfgang <[hidden email]> wrote:

> Sorry, I think I might have been a little sparse on the details.
> The states from the post requests are stored in files and the get
> requests reads of the files to get the status.
>
> What I'm trying to do is:
>
> protected void doPost( HttpServletRequest request, HttpServletResponse
> response ) throws ServletException, IOException {
>                AsyncContext aCtx = request.startAsync( request, response );
>                Executor executor = Executors.newCachedThreadPool();
>                executor.execute( new Calc( aCtx ) );
> }
>
> But the get request still waits?!
>
> On Mon, Feb 6, 2012 at 22:30, kim young ill <[hidden email]> wrote:
>> dont think it's possible.
>> as i understand: for each new request comming in u'll get a new thread to
>> process. if u want to maintain the state of that request, u have to put it
>> somewhere where the other requests can acces (e.g session or even
>> servletcontext)
>>
>> u cannot access one request from another request.
>>
>>
>>
>>
>> On Mon, Feb 6, 2012 at 9:10 PM, Christian Wolfgang <[hidden email]> wrote:
>>>
>>> Thank you for the fast answer.
>>>
>>> I'm not sure if I understand it correctly. I am not interested in
>>> suspending any of the requests.
>>> I want to keep on processing my post request and asynchronously get
>>> status checks on its process.
>>>
>>> Should I dispatch the post request processing in another thread, so
>>> that other request could get access?
>>>
>>> Thanks.
>>>
>>>
>>> Christian
>>>
>>> On Mon, Feb 6, 2012 at 16:22, Jesse McConnell <[hidden email]>
>>> wrote:
>>> > see: http://wiki.eclipse.org/Jetty/Feature/Continuations or servlet
>>> > 3.0 for async servlets
>>> >
>>> > what your running into is that once a request enters into the servlet
>>> > api, it has a thread allocated to it for its lifetime in the
>>> > servlet-api prior to servlet 3.0 where the concept of async was
>>> > supported.  continuations is a mechanism that allows for a similar
>>> > mechanic on jetty in servlet 2.5
>>> >
>>> > and yes, jetty is multithreaded
>>> >
>>> > cheers,
>>> > jesse
>>> >
>>> > --
>>> > jesse mcconnell
>>> > [hidden email]
>>> >
>>> >
>>> >
>>> > On Mon, Feb 6, 2012 at 08:47, Christian Wolfgang <[hidden email]> wrote:
>>> >> Hi.
>>> >>
>>> >> I have a servlet that initiates some work with a post request and with
>>> >> a get request I can get its status. But when I try to get its status,
>>> >> the request is first processed when the post request is done.
>>> >> But if i break up the post request in bits, with Thread.sleep(), the
>>> >> get request can be processed.
>>> >>
>>> >> I thought jetty was multithreaded? Am I wrong or am I doing something
>>> >> wrong?
>>> >>
>>> >> Thanks.
>>> >>
>>> >> Christian
>>> >> _______________________________________________
>>> >> jetty-dev mailing list
>>> >> [hidden email]
>>> >> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>>> > _______________________________________________
>>> > jetty-dev mailing list
>>> > [hidden email]
>>> > https://dev.eclipse.org/mailman/listinfo/jetty-dev
>>> _______________________________________________
>>> jetty-dev mailing list
>>> [hidden email]
>>> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>>
>>
>>
>> _______________________________________________
>> jetty-dev mailing list
>> [hidden email]
>> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>>
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

[jetty-dev] Jetty 8.1.0 CQs

Chris Frost

Hi,

I'm doing some work to integrate Jetty 8.1.0 with Virgo but I can't find CQs for two of the 3rd party jar that are distributed with Jetty.

org.apache.jasper.glassfish_2.2.2.v201112011158.jar
javax.servlet.jsp_2.2.0.v201112011158.jar

I need to raise PiggyBack CQs to keep the IP team happy with Virgo. I have searched plenty, I promise, don't want to raise duplicates though.

Chris.
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Jetty 8.1.0 CQs

Jesse McConnell
https://dev.eclipse.org/ipzilla/show_bug.cgi?id=5779
https://dev.eclipse.org/ipzilla/show_bug.cgi?id=4710

think those are what your looking for from

http://www.eclipse.org/projects/ip_log.php?projectid=rt.jetty

cheers,
jesse

--
jesse mcconnell
[hidden email]



On Thu, Feb 9, 2012 at 09:22, Chris Frost <[hidden email]> wrote:

>
> Hi,
>
> I'm doing some work to integrate Jetty 8.1.0 with Virgo but I can't find CQs for two of the 3rd party jar that are distributed with Jetty.
>
> org.apache.jasper.glassfish_2.2.2.v201112011158.jar
> javax.servlet.jsp_2.2.0.v201112011158.jar
>
> I need to raise PiggyBack CQs to keep the IP team happy with Virgo. I have searched plenty, I promise, don't want to raise duplicates though.
>
> Chris.
> _______________________________________________
> jetty-dev mailing list
> [hidden email]
> https://dev.eclipse.org/mailman/listinfo/jetty-dev
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Jetty 8.1.0 CQs

Chris Frost
Hi,

Thanks, that will do me. The version numbers didn't match up so I wasn't sure.

Chris.

----- Original Message -----
From: "Jesse McConnell" <[hidden email]>
To: "Jetty @ Eclipse developer discussion list" <[hidden email]>
Sent: Thursday, 9 February, 2012 4:05:02 PM
Subject: Re: [jetty-dev] Jetty 8.1.0 CQs

https://dev.eclipse.org/ipzilla/show_bug.cgi?id=5779
https://dev.eclipse.org/ipzilla/show_bug.cgi?id=4710

think those are what your looking for from

http://www.eclipse.org/projects/ip_log.php?projectid=rt.jetty

cheers,
jesse

--
jesse mcconnell
[hidden email]



On Thu, Feb 9, 2012 at 09:22, Chris Frost <[hidden email]> wrote:

>
> Hi,
>
> I'm doing some work to integrate Jetty 8.1.0 with Virgo but I can't find CQs for two of the 3rd party jar that are distributed with Jetty.
>
> org.apache.jasper.glassfish_2.2.2.v201112011158.jar
> javax.servlet.jsp_2.2.0.v201112011158.jar
>
> I need to raise PiggyBack CQs to keep the IP team happy with Virgo. I have searched plenty, I promise, don't want to raise duplicates though.
>
> Chris.
> _______________________________________________
> jetty-dev mailing list
> [hidden email]
> https://dev.eclipse.org/mailman/listinfo/jetty-dev
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev