<p>My guess is that class variables ("class var") are truly global in storage (that is, one instance for the entire application).</p>

<p>But I am wondering whether this is the case, or whether they are thread in storage (eg similar to a "threadvar") - once instance per thread.</p>

<p>Anyone know?</p>

<p><em>Edit: changed "scope" to "storage" as this is in fact the correct terminology, and what I am after (thanks Barry)</em></p>

[{'answer_id': 82148, 'author': 'Daniel', 'author_id': 6852, 'author_profile': 'https://Stackoverflow.com/users/6852', 'pm_score': 4, 'selected': True, 'text': '<p>Yes, class variables are globally scoped.  Have a look in the RTL source for details of how threadvars are implemented.  Under Win32 each thread can have a block of memory allocated automatically to it on thread creation.  This extra data area is what is used to contain your threadvars.</p>\n'}, {'answer_id': 83026, 'author': 'Barry Kelly', 'author_id': 3712, 'author_profile': 'https://Stackoverflow.com/users/3712', 'pm_score': 4, 'selected': False, 'text': '<p>Class variables are scoped according to their member visibility attributes, and have global storage, not thread storage.</p>\n\n<p>Scope is a syntactic concept, and relates to what identifiers are visible from where. It is the storage of the variable that is of concern here.</p>\n'}, {'answer_id': 88987, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': '<p>Class variables are just like classes: global and unique for the application.</p>\n'}]
['https://Stackoverflow.com/questions/82113', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11820/']