# SD212 HW 23

## [name] Type your name on the next line


## [Q1]

> Did you read the entire post?
>
> (Answer yes or no)


## [Q2]

> Check out the following function. It uses a global variable to add
>
> to a running sum:
>
> ````````````````````
> sum = 0
>
> def addtosum(n):
>     sum += n
> ````````````````````
>
> What is the correct syntax to create a new thread to run this
> function with input n=25?
>
> a)  `t1 = threading.Thread(addtosum, 25,)`
> b)  `t1 = threading.Thread(target=addtosum, args=(25,))`
> c)  `t1 = threading.Thread(target=addtosum(25),)`
> d)  `t1 = threading.Thread(target=addtosum)(25)`
>
> (Just enter the letter of the correct choice.)


## [Q3]

> The previous example function `addtosum`
>
> works with threading but not with multiprocessing. Why not?
>
> a)  GIL
> b)  Race condition
> c)  Shared memory
> d)  Deadlock
> e)  *Akshually* it does work


## [Q4]

> What is one thing in this reading that you're still unsure/confused
>
> about and would like to discuss more in class?


