Some small tidying up.
Chris Pressey
8 years ago
13 | 13 | which they write to and read from is shared between them. |
14 | 14 | |
15 | 15 | It then computes all possible interleavings of these two programs, and |
16 | executes them all, each on a freshly-zeroed shared memory. Unless _all_ | |
17 | the interleavings leave the memory in exactly the same state after execution, | |
18 | the programs have a race condition. | |
16 | executes them all, each on freshly-zeroed registers and shared memory. Unless | |
17 | _all_ the possible interleavings leave the memory in exactly the same state | |
18 | after execution, the programs have a race condition. | |
19 | 19 | |
20 | 20 | Basic Examples |
21 | 21 | -------------- |
30 | 30 | |
31 | 31 | PROG 1 |
32 | 32 | |
33 | INC M1 | |
33 | INC M0 | |
34 | 34 | |
35 | 35 | But the following two programs _do_ have a race condition: |
36 | 36 | |
59 | 59 | |
60 | 60 | There are two pragmas. The first, `DESC`, indicates a section of the |
61 | 61 | program which contains a human-readable (and computer-ignored) description |
62 | of the program. The other, `PROG`, specifies which program is being given | |
63 | next in the file. | |
62 | of the following program(s). This description is not free-form; it should be | |
63 | given in terms of comments. | |
64 | ||
65 | The other pragma, `PROG`, is followed by an integer which specifies which | |
66 | program is being given next in the file. | |
64 | 67 | |
65 | 68 | These pragmas are only used when the source is a single text file; |
66 | 69 | if the two programs are being given separately, for example in individual |
135 | 138 | Can you give me an example? Can you tell me about one you had to find |
136 | 139 | and fix?" during phone screens.) |
137 | 140 | |
138 | A huge example that is relevant to virtually every programmer is the | |
141 | A glaring example that is relevant to virtually every programmer is the | |
139 | 142 | filesystem. It's a big, shared, mutable store. There are often some |
140 | 143 | operations, like renaming a file, that are guaranteed to be atomic; but |
141 | 144 | most filesystem operations do not have this guarantee. |
171 | 174 | TODO |
172 | 175 | ---- |
173 | 176 | |
174 | * better "(can't happen)" | |
175 | ||
176 | Slightly more advanced TODO items (might not happen before release): | |
177 | ||
178 | 177 | * improve error-checking subsystem to report the program and line number |
179 | 178 | * better output on "Find RCs" -- explain why it failed |
180 | 179 | * animation style selector: staggered, black + white, no animation |