Bob Ippolito wrote:
> On 11/5/06, Ben Sizer <[EMAIL PROTECTED]> wrote:
> > If you know which methods are synchronised and which ones aren't, then
> > it's possible to prove whether it will always work or not.
> > Unfortunately I don't have this sort of information and I was hoping
> > someone here would.
>
> Audit the source then. See what kind of locking it tries to do.

I'm not exactly well-qualified to understand all that code though. And
between the various subprojects, there is certainly a lot of code.

> The safest thing to do of course is to only send immutable objects
> across threads, or deep copies of mutable objects (message passing).
> Pretty hard to screw that up.

Sure, but obviously when you use a framework like TurboGears, a lot
takes place under the hood. And I think it's important to document
these things.

For example, I was concerned that if 2 threads each created an
SQLObject-derived instance that referred to the same underlying data,
would there be some sort of clash? I found in the SQLObject
documentation that it ensures you get the same object in both threads,
which is at least some help, though it is still a little vague. ("If
you ask for a person by a particular ID more than once, you'll get back
the same instance. This way you can be sure of a certain amount of
consistency if you have multiple threads accessing the same data
(though of course across processes there can be no sharing of an
instance). This isn't true if you're using transactions, which are
necessarily isolated.)

I expect that the above guarantee will be enough for my limited use of
threaded database access, but others may have more complex questions
which I hope someone can answer later.

-- 
Ben Sizer


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to