Problem: given a set of processes. Each process has a list of instructions that sends/receives message to/from other processes. A instruction can be blocking or non-blocking. Output the finish time of each process, and the list of processes prevent a process to finish if it will never finish. Size: 26 processes and 100 instructions for each process at most.
Just do simulation run. Instructions and messages can be stored in arrays. Simulates until no instructions is executed and no messages passed. Finally, print the message queue is the answer.
No comments:
Post a Comment