Re: Picking up .wo changes
Re: Picking up .wo changes
- Subject: Re: Picking up .wo changes
- From: Pierre Frisch <email@hidden>
- Date: Fri, 6 Jun 2003 17:27:46 -0700
On Friday, June 6, 2003, at 04:03 PM, Chuck Hill wrote:
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.
The session default editing context is locked / unlocked for you by
default by the session in the awake and sleep if you stay with this or
any nested editing context you are safe and so for most user it works.
If you have peer editing context and don't lock them you are going to
see nasty things. This include very bizarre exception, and null pointer
exceptions. I would not say that this is an option for peer editing
context.
Pierre
_______________________________________________
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.