Code

Changes between Version 19 and Version 20 of DjangoSpecifications/Core/Threading


Ignore:
Timestamp:
04/14/08 12:25:35 (6 years ago)
Author:
mrts
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DjangoSpecifications/Core/Threading

    v19 v20  
    2424 * inefficiencies due to calls meant to occur only once occurring more than once (the general `if not foo: initialize foo`, including `memoize` decorator), 
    2525 * errors due to incomplete initialization. 
     26 
     27When evaluating the inefficiencies, their impact should be considered in terms of their probability and the overhead of duplicated call. The wors case, 
     28{{{ 
     291. thread 1: if not foo: needs initializing 
     302. thread 2: if not foo: needs initializing 
     313. thread 1: initialize foo 
     324. thread 2: initialize foo 
     33}}} 
     34is 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. 
    2635 
    2736Incomplete initialization errors can generally be avoided by using full assignment instead of elementwise modification (that's how it is done in the source mostly):