• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Tomcat 6.0 / Multiple CPU processes out of order

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all, I am not sure if I have the right forum but here we go. I have a j2ee web app running on Tomcat 6.0 on a 2 processor machine and I am doing several html submits in a certain sequence. Let us say I am doing 3 submits. 2 submits are done using jQuery post. The other 1 submit is done using javscript document.forms[0].submit(). On my machine, the 3 submits always occur in the proper order, regardless of whether 1 or 2 processors are used to handle this sequence.

When I go to another multi-CPU machine with Tomcat 6.0 and same app, when two processors have these submits divided between them, the 3 submits occur out of sequence. One of the processors comes in horribly late compared to the other processor which started the work. I need the second processor to begin its part earlier if two processors are to be used for this sequence.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What exactly is "our of order"?
If these submits are all HTTP requests done by the client browser, doesn't the browser work the same every time?
Or are you referring to the order in which the responses are completed?

Bill
 
Greg Werner
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

William Brogden wrote:What exactly is "our of order"?
If these submits are all HTTP requests done by the client browser, doesn't the browser work the same every time?
Or are you referring to the order in which the responses are completed?

Bill



If I have (jQuery)Post A, (jQuery)Post B, (javascript submit()) Post C performed on a single jsp, I need the order they are executed in the servlet layer to be doPost() of A doPost() of B and doPost() of C. I know they are independent threads, but I would like to somehow impose ordering for the 3 requests or force the use of a single processor for the 3 requests since I consider them a single atomic item (like I really would want the 3 requests to be a single thread). I posted here because I was thinking maybe there was some way of tinkering with the ThreadPool or something to impose ordering.
 
Sheriff
Posts: 67590
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ummm, no. You'll either need to chain them on the client, or combine them into a single request.

This waves a huge red flag. What are you really trying to accomplish?

 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:You'll either need to chain them on the client...



Never used these, but you get the idea...

http://code.google.com/p/jquery-ajaxq/
http://www.protofunc.com/scripts/jquery/ajaxManager/
http://plugins.jquery.com/project/ajaxqueue
 
Greg Werner
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Ummm, no. You'll either need to chain them on the client, or combine them into a single request.

This waves a huge red flag. What are you really trying to accomplish?



Acutally Bear this is sort of in conjunction with another forum topic I posted in here before. The fundamental task I am trying to accomplish is passing tons and tons of data between jsp pages. I think if I set maxPostSize="0" in my Tomcat server.xml file that would do it? I was trying to come up with away of working around some kind of post length limit i was running into. I can do a single request if I can overcome the post length limit I am running across, and I think that might be why posts of a certain length I was reaching were failing. I just did not discover that feature of Tomcat until now because I am more familiar professionally with oc4j.
 
Saloon Keeper
Posts: 24315
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Both Tomcat and the popular web browsers run multiple concurrent threads, so if you want synchronicity, you'll have to explicitly enforce it on the client side. Although you're seeing this in a multi-CPU environment, even in a single-core system you have the same risk.
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, now I am curious about your working environment - what is this "post length limit" and where is it enforced?

The phrase:

passing tons and tons of data between jsp pages.



is rather alarming - are you really using JSP to process tons of data?

Bill
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic