Difference between revisions of "Producer-Consumer System/Criteria"
Jump to navigation
Jump to search
(Created page with "* At least one producer * At least one consumer * No thread is both consumer and producer * Buffer capacity is at least 1 * The type of data is nonempty") |
|||
Line 4: | Line 4: | ||
* Buffer capacity is at least 1 | * Buffer capacity is at least 1 | ||
* The type of data is nonempty | * The type of data is nonempty | ||
<noinclude> | |||
<syntaxhighlight> | |||
EXTENDS Naturals, Sequences | |||
CONSTANTS Producers, (* the (nonempty) set of producers *) | |||
Consumers, (* the (nonempty) set of consumers *) | |||
BufCapacity, (* the maximum number of messages in the bounded buffer *) | |||
Data (* the set of values that can be produced and/or consumed *) | |||
ASSUME /\ Producers # {} (* at least one producer *) | |||
/\ Consumers # {} (* at least one consumer *) | |||
/\ Producers \intersect Consumers = {} (* no thread is both consumer and producer *) | |||
/\ BufCapacity > 0 (* buffer capacity is at least 1 *) | |||
/\ Data # {} (* the type of data is nonenpty *) | |||
... | |||
</syntaxhighlight> | |||
</noinclude> |
Revision as of 12:43, 25 August 2021
- At least one producer
- At least one consumer
- No thread is both consumer and producer
- Buffer capacity is at least 1
- The type of data is nonempty
EXTENDS Naturals, Sequences
CONSTANTS Producers, (* the (nonempty) set of producers *)
Consumers, (* the (nonempty) set of consumers *)
BufCapacity, (* the maximum number of messages in the bounded buffer *)
Data (* the set of values that can be produced and/or consumed *)
ASSUME /\ Producers # {} (* at least one producer *)
/\ Consumers # {} (* at least one consumer *)
/\ Producers \intersect Consumers = {} (* no thread is both consumer and producer *)
/\ BufCapacity > 0 (* buffer capacity is at least 1 *)
/\ Data # {} (* the type of data is nonenpty *)
...