# Answers to Questions for Assignment 1
Please provide short answers to the questions below and submit the file as part of
your assignment submission as a file named `results/answers.md`.
## Preliminaries
If you have any preliminary comments on your submission, notes for the TAs, please
give them here.
Please cite any offline or online sources you consulted while preparing your
submission, other than the Pintos documentation, course text, lecture notes, and
course staff.
## pthreads
### Q1: Is the program's output the same each time it is run? Why or why not?
### Q2: Based on the program's output, do multiple threads share the same stack?
### Q3: Based on the program's output, do multiple threads have separate copies of global variables?
### Q4: Based on the program's output, what is the value of `void *threadid`? How does this relate to the variable's type (`void *`)?
### Q5: Using the first command line argument, create a large number of threads in `pthread`. Do all threads run before the program exits? Why or why not?
## pthread_words
### Q1: Briefly compare the performance of `list_words` and `pthread_words` when run on the Gutenberg dataset. How might you explain their relative performance? Hint: use the `time` command for this.
### Q2: Under what circumstances would `pthread_words` perform better than `list_words`?
### Q3: Under what circumstances would `list_words` perform better than `pthread_words`?
### Q4: Is it possible to use multithreading in a way that `pthread_words` always performs better than `list_words`? Explain