PR# 20041 SCOOP dining_savages example

Problem Report Summary
Submitter: gobobe
Category: SCOOP
Priority: Low
Date: 2026/08/22
Class: Bug
Severity: Non-critical
Number: 20041
Release: 25.12.9.8922
Confidential: No
Status: Open
Responsible:
Environment: win
Synopsis: SCOOP dining_savages example

Description
I think that there is a bug in the design of this SCOOP example, in class SAVAGE: https://github.com/EiffelSoftware/es-libraries/blob/master/Src/examples/scoop/dining_savages/savage.e.
Let's assume that 21 savages still need to be fed (with 1 meal missing for all of them), and there is one meal left in the pot. And let's assume that the SCOOP scheduler executes the 21 calls to SAVAGE.fill_pot before the 21 calls to SAVAGE.get_serving_from_pot. As far as I can see there is nothing in the SCOOP specification preventing this scheduling. None of the 21 calls to `fill_pot` will refill the pot because it is not empty (there is still one meal in it). Now the first savage calling `get_serving_from_pot` will empty the pot. Then when the 20 other savages call `get_serving_from_pot` the pot is empty and they will wait forever for the pot to be refilled (but no one will refill it).

So this example works just because we are lucky that the SCOOP scheduler does not reproduce the scenario described above. But there is nothing telling us that this will never happen.

--
Eric Bezault
To Reproduce

										
Problem Report Interactions