[Seaside] Re: Are Collections threadsafe?

Andreas Raab andreas.raab at gmx.de
Wed Feb 27 07:06:47 UTC 2008

Philippe Marschall wrote:
> That's simple if your image blocks. If your image doesn't blocks but
> the behavior you get looks as if your critical sections are not
> critical what do you do then? Attach gdb at random points in time?
> Would that really help?

Taking a couple of samples that you can analyze off-line is definitely 
worthwhile (I've done it actually today to get a feel for a particular 
slowdown in our app). The other thing you can do is to add sanity 
checks. For example: It can be helpful to make your own kind of mutex so 
that you can see whether the signal count is ever more than one (this is 
one of the things that helped me tracking some of the Delay issues).

Generally speaking: Define the invariants that you believe to be true 
(like: Semaphore must have either zero or one signals) and attribute 
your code to verify these assumptions. If you see them violated try to 
find the first place where things go wrong and then debug it from there.

   - Andreas

More information about the seaside mailing list