Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Is jetty multithreaded

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 <chw@xxxxxxxxxx> 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 <khiemu@xxxxxxxxxxxxxx> 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 <chw@xxxxxxxxxx> 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 <jesse.mcconnell@xxxxxxxxx>
>>> 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
>>> > jesse.mcconnell@xxxxxxxxx
>>> >
>>> >
>>> >
>>> > On Mon, Feb 6, 2012 at 08:47, Christian Wolfgang <chw@xxxxxxxxxx> 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
>>> >> jetty-dev@xxxxxxxxxxx
>>> >> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>>> > _______________________________________________
>>> > jetty-dev mailing list
>>> > jetty-dev@xxxxxxxxxxx
>>> > https://dev.eclipse.org/mailman/listinfo/jetty-dev
>>> _______________________________________________
>>> jetty-dev mailing list
>>> jetty-dev@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>>
>>
>>
>> _______________________________________________
>> jetty-dev mailing list
>> jetty-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>>


Back to the top