An example of the real world of lunch philosophers?

Producer / Consumer and reader / writer are easy to think about, but what about lunch philosophers? In what situation will N processes and resources N lie on a ring topology and alternate with each other? I could think of N processes competing for M resources, but in this case, each process can use any two resources.

The wiki said Dijkstra used it to simulate computers competing for streamer peripherals. Does this scenario still exist in the modern era?

+4
source share
2 answers

I find the issue of executing a transaction between two accounts very similar to the problem of dining philosophers. In order to complete a transaction, the thread must block both accounts to ensure that the correct value is debited from one account (first assuring that there are available funds) and credit to the other.

Topology is not quite a round table, but very close. Present 5 bills at the table. In this analogy, accounts are forks. Any two accounts can participate in a transaction. Transactions == Philosophers. Thus, in this example, transactions (philosopher) can not only sit at the edge of the table between two accounts (forks), but also on the line crossing the table, connecting any two accounts (forks).

+1
source

"" - , , , , , , , .

, - , , .

, , , "", "" - , , . , :)

0
source

Source: https://habr.com/ru/post/1530655/


All Articles