Code

Changes between Version 46 and Version 47 of DjangoSpecifications/Core/Threading


Ignore:
Timestamp:
04/26/08 13:56:32 (6 years ago)
Author:
mrts
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DjangoSpecifications/Core/Threading

    v46 v47  
    8282 
    8383There are four types of globals: 
    84  1. globals that are assigned to at module level and never modified later (THREAD-SAFE), 
    85  1. globals that are assigned to at module level and whose elements are modified with module level code, but never modified later (PROBABLY THREAD-SAFE, although elementwise modification at module level is not thread-safe ''per se'', the module is most likely cached ''before'' threads get access to it) 
    86  1. global mutable data structures (lists and dictionaries, also instances) that are assigned to at module level but whose elements are modified in functions and that are accessed without using the `global` keyword (NOT THREAD-SAFE), 
    87  1. globals assigned to in functions by using the `global` keyword (NOT THREAD-SAFE), 
     84 1. globals that are initialized at module level and never modified later (THREAD-SAFE), 
     85 1. global mutable data structures that are initialized at module level and whose elements are modified with module level code, but never modified later (PROBABLY THREAD-SAFE, although elementwise modification at module level is not thread-safe ''per se'', the module is most likely cached ''before'' threads get access to it) 
     86 1. global mutable data structures (lists and dictionaries, also instances) that are initialized at module level but whose elements are modified in functions and that are accessed without using the `global` keyword (NOT THREAD-SAFE), 
     87 1. globals initialized in functions by using the `global` keyword (NOT THREAD-SAFE), 
    8888 
    8989=== Modules' use of globals === 
     
    151151 
    152152As with globals, there are three types of class variables, 
    153  1. class variables that are assigned to when the class is defined and never modified later (THREAD-SAFE), 
    154  1. mutable class level data structures (lists and dictionaries, also instances) that are assigned to when the class is defined but whose elements are modified in methods and that are accessed without using the `__class__` keyword (NOT THREAD-SAFE), 
    155  1. class variables assigned to in methods by using the `__class__` keyword (NOT THREAD-SAFE), 
     153 1. class variables that are initialized when the class is defined and never modified later (THREAD-SAFE), 
     154 1. mutable class level data structures that are initialized when the class is defined but whose elements are modified in methods and that are accessed without using the `__class__` keyword (NOT THREAD-SAFE), 
     155 1. class variables initialized in methods by using the `__class__` keyword (NOT THREAD-SAFE), 
    156156 
    157157Metaclasses -- think through the implications.