Optimal Dynamic Scheduling of a General Class of Parallel-Processing Queueing Systems