Dining philosophers: Difference between revisions

(Added Delphi example)
Line 3,442:
S - Starting time for the new activity
Q - Queue
U - Upper bound for the number of philosophers whichwho can eat simultaneously
P - Active philosopher
E - Elapsed Time (only for information purposes)
Line 3,460:
(N Q)`((;: o N) j (''c)) h NB. Boxing the names, empty queue
(A T)`((0:items j thinktime&>) o N) h NB. All start thinking
(E U)`(0 ; <. o (2 %~ # o N)) h NB. elapsedElapsed time 0, Upper bound
[ echo o (time , 'All of them start thinking.'c)
)
Anonymous user