Skip to content

Instantly share code, notes, and snippets.

View AndriSig's full-sized avatar

Andri Már Sigurðsson AndriSig

View GitHub Profile
-module(sushi).
-export([main/1, run/3]).
%% K is the number of chairs, N is the number of customers.
%% Initializes the threads and waits for it to finish
main([K, N, SleepTime|_]) ->
init(list_to_integer(K)),
gen_customers(list_to_integer(N), list_to_integer(SleepTime)),
loop(0, list_to_integer(N)),
unregister(main),