Implementation of Ricart-Agrawala mutual exclusion algorithm with Roucairol-Carvalho optimization