I'm a little torn about the cleverness in using a null on the AgentWaiterList to signify a blocking wait. IIUC, there can be at most one null value, and it's always first, so really it's just a flag bit, and the AWL could be a record with that flag broken out and a list of non-null records, or the flag could possibly be directly on the Agent Record.
On the one hand, it's clever. On the other hand, it introduces generality (and thus some conceptual complexity, in return for implementation simplicity) where none is really called for.
I think that if we keep the mechanism as it is, we should at least note the above useful facts about it in the third para of the intro (the one defining AWL).
Indeed, it's just a flag. Maybe it serves a very small explanatory purpose to illustrate the line cutting behavior, but I agree, it's simpler to have it as a flag.
I'm a little torn about the cleverness in using a null on the AgentWaiterList to signify a blocking wait. IIUC, there can be at most one null value, and it's always first, so really it's just a flag bit, and the AWL could be a record with that flag broken out and a list of non-null records, or the flag could possibly be directly on the Agent Record.
On the one hand, it's clever. On the other hand, it introduces generality (and thus some conceptual complexity, in return for implementation simplicity) where none is really called for.
I think that if we keep the mechanism as it is, we should at least note the above useful facts about it in the third para of the intro (the one defining AWL).