fabric-engine/PublicDev — pull request #105 by jcgagnon (2012-04-30 23:19:59+00:00)
Title: Report with Node/Op name + Win64 exceptions as report Part 1 (EDK set/get error)

@peter This is for node/op name logging + getLastError stuff. This doesn't include OOB exceptions report. Since I'm quite late on my schedule I might need your help on that one...

So: I'm sorry, what could have been a very small change ended up being quite big, mostly because I didn't want to make the code less clean. It took me literally 1 week and 10 iterations to have it "kind of right"; I'm not very proud of that since it might have taken you less than 1 day. Still, at least I learned many things in the Core... Note that I did the changes for logging with Node/Op name at the same time, since it was kind of the same work. I tried to do it with very low overhead.

So now, about those many changes. Your first reaction might be "what the f***"... let me tell what I tried to achieved (probably I tried too hard with too many constraints):

- avoid too many function calls (and virtual functions) when calling into KL/execute; have it inline-friendly as much as possible
- avoid code duplications; there are about 20 entry points into KL in total
- have it centralized, even if DG, MR and KL tool work a bit differently
- clean up things, not just make them more complex
- don't pollute MT with KL/DG stuff (including MT::ParallelCall); even clean it up by removing notion of LogCollector from it
- avoid including DG specific stuff in MR, or KL tool
- avoid managing too much TLS variables; centralize them (log collector, context, error state, EDK callbacks, exception logging)

At least, I fixed a few real bugs. The best one: AutoSet<>'s destructor was implemented as its default constructor (~ missing)

I tried to build unit tests tests for DG and MR which make sure that threads are not messing each others' status (KL error).