April 12, 2019
For today:
1) Finish Homework 8 (due Tuesday tonight)
2) Read Think OS Chapter 9 and do the reading quiz
3) Start Homework 9 (due Friday night)
4) Work on your project
Today:
1) Project 1 recap
2) Threads
3) Homework 9 questions
4) Start Homework 10
For next time:
1) Read HFC Chapter 12 (so we can do processes and threads back to back)
2) Start Homework 10
3) Work on your project
I've graded all of them unless there was something missing, so if you don't have a grade, check Canvas to see what I asked about.
Mostly I was looking for evidence of productive engagement, and I was happy with what I saw:
1) Teams used Trello in different ways, but I didn't see obvious anti-patterns.
2) GitHub commits showed steady progress and contributions from all members (seeing merge conflicts is a particularly good sign, because it suggests parallel progress, if not perfect communication)
3) The reports achieved the goal of documenting your work at a level appropriate for future students and future employers.
4) Most teams reached their MVP and achieved their learning goals (at least, according to self reports :)
Suggestions:
1) Remember this?
At the top of this document, give your project a meaningful name that at least suggests the topic of the project. Do not call it "Software Systems Project 2".
2) Use Markdown features and check that they are rendered correctly!
3) For code snippets, it is better to paste in text in a code block (see above) rather than screen shots.
Short for "thread of execution".
Process = address space + thread of execution
When you create a process, you get the first thread free; after that, you have to spawn them yourself.
Of all the things that make up a process, which are owned by a single thread and which are shared among all threads?
1) Code segment
2) Static segment
3) Global segment
4) Heap
5) Stack
6) Hardware state (data registers, program counter, instruction register, status register, etc).
7) Process control block
8) File descriptors
9) Open sockets
10) Page table
In class today we'll work with the code for Exercise 12, so you will have a head start on the next homework.
1) In the Exercise 12 directory, read counter.c and then compile and run it:
cd ExercisesInC/exercises/ex12
make
2) Draw a thread diagram (similar to the process diagrams we drew last time) showing the sequence of operations performed by the parent and child threads.
3) Based on this code and what it does, do you think threads share the heap segment? How can you tell?
4) Do they share the global segment? Again, how can you tell?
5) Do you think each thread has its own stack? Hint: yes. But how can we tell?
6) Print the addresses of local variables in at least two threads, and draw a map of the virtual address space showing how the stacks are arranged.