algorithm critical sections 427791