In Python specifically, how do variables get shared between threads?
Although I have used ```threading.Thread``` before I never really understood or saw examples of how variables got shared.  Are they shared between the main thread and the children or only among the children? When would I need to use thread local storage to avoid this sharing?
I have seen many warnings about synchronizing access to shared data among threads by using locks but I have yet to see a really good example of the problem. 
Thanks in advance!
So, I'm on vacation in Utah, and so I attended an LDS service. In the morning, I heard a reading from one of the Presidents of the church during the "Quorum of the Elders," then went to Sunday School, and finally witnessed the Sacrement of the bread and water. (I guess it makes sense there was no wine, but it did make me go "Huh!") After that, there were testimonies from missionaries and some music - but nothing that struck me as a sermon. 
Was I missing something, or was this an atypical service? I guess I was trying to understand what the "pastor"s role in the service was supposed to be - or again, is it just that Mormons are even more Baptist than baptists?
If someone could explain how instruction and exhortation are primarily conferred in the LDS church Id appreciate it.  Thanks!

1 Answers

In the Church of Jesus Christ of Latter-day Saints (LDS Church), or Mormonism, the primary methods of teaching and instruction occur during Sunday School lessons, Relief Society (women's organization), Priesthood (men's organization), and other auxiliary meetings. The weekly Sacrament Meeting, however, differs in its format and purpose compared to a traditional Protestant sermon.

Sacrament Meeting is the central weekly worship service for LDS members. It consists ofarily music, the Sacrament
It's important to understand that in Python, by default, all variables created inside a function or a class are considered "global to that function or class" and are not thread-local. This means that when you create multiple threads and they all have access to the same Python object (which is the case for most variables), they can all modify that object without any explicit synchronization.
Here's an example to illustrate this:
```python
import threading
counter = 0
def increment_counter():
    global counter
    counter += 1
threads = []
for i in