April 26, 2019
For today:
1) Read Think OS Chapter 11 and do the reading quiz
2) Finish Homework 11
3) Work on your project
Today:
1) TOS Chapter 11
2) Start Homework 12 (Exercise 13)
2) Project check in
For next time:
1) Prepare for a quiz (here's last year's quiz for practice)
2) Read Head First C Chapter 10
3) Work on Homework 12 (exercise 13)
4) Work on project
Correction: In Chapter 11 I said that sem_t behaves like a structure, which means that if you pass it by value (not by pointer) it makes a copy, and making a copy of a semaphore is a bad idea. I was wrong.
Actually, sem_t is a synonym for atomic_t, which is a synonym for a volatile unsigned char.
How do I know? I read the source code.
http://brickos.sourceforge.net/docs/APIs/html-c/semaphore_8h-source.html
http://brickos.sourceforge.net/docs/APIs/html-c/atomic_8h-source.html
This integer is probably an index into a table of structures. This indirection prevents client code from accessing the contents of the semaphore or copying the structure.
This interface is an example of a Handle.
1) Read list_errors.c and draw a diagram for the mysterious data structure.
2) Read word_count.c and draw a diagram for the data structures.
How can we deallocate data structures like this?