Examples icon indicating copy to clipboard operation
Examples copied to clipboard

Co-locate steps to remove a process from waiting queue in ReadersWriters example

Open wrobell opened this issue 2 years ago • 1 comments

The steps to remove a process from the waiting queue are

  • get the head of the queue
  • remove the head by keeping the tail of the queue

These two steps are spread across Read, Write, and ReadOrWrite operators. This makes the specification harder to understand.

Improve the readability of the specification by keeping all the steps within ReadOrWrite operator.

wrobell avatar Jun 02 '22 17:06 wrobell

BTW. Maybe renaming of the operators would be a good idea as well, i.e.

  • TryRead -> EnqueueForRead
  • TryWrite -> EnqueueForWrite
  • ReadOrWrite -> DequeueProcess

wrobell avatar Jun 02 '22 17:06 wrobell

Naming is hard.

lemmy avatar Jan 15 '23 20:01 lemmy