The algorithm sketched above is general enough to be suitable for any distributed system, but when using a system with shared memory (e.g., a single multiprocessor machine) a more efficient implementation is possible.
we can avoid the master/slave architecture and simply start p threads that each compute and execute updates independently, with a synchronization lock on θ.