[Seaside] thread-safety
Avi Bryant
avi at beta4.com
Wed Dec 31 01:31:03 CET 2003
On Dec 30, 2003, at 4:02 PM, radoslav hodnicak wrote:
> I was wondering (haven't seen this discussed here) how to make my
> seaside
> app "single-threaded", since all the smalltalk code I'm using is
> (presumably) not thread-safe (and I don't really want to deal with all
> the
> thread safety issues, it doesn't buy me anything).
>
> Julian told me that multiple requests in one session get serialized on
> a
> mutex (can't find the place in code) but this is not good enough.
Normally this gets taken care of by whatever transaction/persistence
mechanism you are using. I try to structure Seaside applications so
that each session is completely separate, with indepedent access to the
domain objects (with OmniBase this means having its own transacation,
with GOODS its own client connection, with GLORP its own object cache,
etc). Since you don't have to worry about thread-safety within a
single session, this works out nicely. But there are other
possibilities - for example, a Prevayler style where every request to
modify the model goes through a single bottleneck so that the
modifications can be serialized and logged, no matter how many threads
are going at once.
What kind of persistence are you using?
Avi
More information about the Seaside
mailing list