An Efficient Control-Driven Period Optimization Algorithm for Distributed Real-Time Systems