Changes between Version 19 and Version 20 of DjangoSpecifications/Core/Threading
- Timestamp:
- Apr 14, 2008, 2:25:35 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DjangoSpecifications/Core/Threading
v19 v20 24 24 * inefficiencies due to calls meant to occur only once occurring more than once (the general `if not foo: initialize foo`, including `memoize` decorator), 25 25 * errors due to incomplete initialization. 26 27 When evaluating the inefficiencies, their impact should be considered in terms of their probability and the overhead of duplicated call. The wors case, 28 {{{ 29 1. thread 1: if not foo: needs initializing 30 2. thread 2: if not foo: needs initializing 31 3. thread 1: initialize foo 32 4. thread 2: initialize foo 33 }}} 34 is not that common and there are no large initialization overhead cases below, so the "inefficiency issues" are really non-issues. There is at least one bug though. 26 35 27 36 Incomplete initialization errors can generally be avoided by using full assignment instead of elementwise modification (that's how it is done in the source mostly):