• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Picking up .wo changes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Picking up .wo changes


  • Subject: Re: Picking up .wo changes
  • From: Chuck Hill <email@hidden>
  • Date: Fri, 06 Jun 2003 16:03:55 -0700
  • Organization: Global Village Consulting, Inc.

Hi,

More threading, what fun!  :-)

Anders F Bjvrklund wrote:
Pierre Frisch wrote:

If I ever want to enable "concurrent requests", you mean ?
Otherwise WebObjects would only be running a single request at a time anyway, would it not ?

Concurrent request handling is the default behavior in WO 5.x and I would not bank to much on the ability to disable it. I remember reading somewhere that WO 5.x is always multithreaded and that you should never make the single thread assumption.

I don't think that is quite correct. The default in 5.x (and as far back as I can recall) is to not dispatch requests concurrently. See allowsConcurrentRequestHandling() in WOApplication. However, regardless of what this is set to, there are always multiple threads running in a Java app. *That* is why you should never make the single thread assumption. Suspend the JVM while a WO App is running and take a look at the thread list (see previous postings, your debugger, or java.sun.com on how to do this for various OS platforms). Look at all those threads. I recall at least a finalizer thread and a session timeout thread along with all the worker threads.

That said, in practice it is reasonably safe* to not lock if you are not doing concurrent dispatch if you are certain that the session timeout and finalizer threads won't do any EOF things. I suspect they do, disposing of the defaultEditingContext() being something that comes to mind.

*I say reasonably safe as I've heard of a lot of people doing this (and I confess I've done it too) and not having huge, life threatening problems. I'm *not* saying it is a good idea. It might only appear to be OK as these threads don't do any EOF things very often so collisions are rare.


It is ? I was under the impression that it wasn't, and that you were supposed to muck around with WOLongResponsePage components? (which *are* threaded).
>
And you *will* need to lock if yoru LRP does anything with EOF.


A test application I just did in WO 5.2 sets "WOAllowsConcurrentRequestHandling=false", and WOApplication.allowsConcurrentRequestHandling returns false?
It does have a "WOWorkerThreadCount=8", but isn't that just for converting the requests from the adaptor? (behind the scenes, like garbage collecting)
Yes.


And it handled each request in sequence, each one waiting nicely for it's turn (too long wait translates to a dead instance in a wotaskd deployment scenario)

Yes.



One can get some really nasty deadlock issues, from unlocked editingcontexts for instance, so multi-threading isn't that easy to do...
I recall Apple recommending running several app instances instead (and buying a few more Apple server boxes while you were at it :-)


:-) Gotta sell that hardware! I think this is the reccomendation and the easiest way to go. It does not help with long running requests though.


Chuck

--

Chuck Hill                                 email@hidden
Global Village Consulting Inc.             http://www.global-village.net

Progress is the mother of all problems.
- G. K. Chesterton
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Picking up .wo changes
      • From: Anders F Björklund <email@hidden>
    • Re: Picking up .wo changes
      • From: Pierre Frisch <email@hidden>
References: 
 >Re: Picking up .wo changes (From: Anders F Björklund <email@hidden>)

  • Prev by Date: Re: Picking up .wo changes
  • Next by Date: Re: Picking up .wo changes
  • Previous by thread: Re: Picking up .wo changes
  • Next by thread: Re: Picking up .wo changes
  • Index(es):
    • Date
    • Thread