-------------------------------------------------------------------- Question: What is the maximum number of processes ever created? Answer: The project description did not say. You can assume that there are at most 20. -------------------------------------------------------------------- Question: What is the maximum possible value for the sleep time? Answer: The project description did not say. You can assume that the sleep time is at most 255. -------------------------------------------------------------------- Question: In the out3-04.txt, the quantum is acting as if it is 2, but it has not been set to 2. Why is it not the default value of 1? Answer: You are correct. There was an error in out3-04.txt and out3-05.txt such that they inherited the quantum from the previous run. The output files have been changed and loaded on the website. -------------------------------------------------------------------- Question: Here is a question regarding the implementation of PTexecute. Are we to implement it so that the same program can have multiple entities in our process table (but each would have different ids)? For example, should these lines of code: 3 1 PTexecute this.xex 4 1 PTexecute this.xex 5 1 PTexecute this.xex cause an error? Or should the process table have three different processes with the program name of this.xex and ids of (say) 0, 1, and 2? Answer: The same .xex file could be executed multiple times concurrently. So you could end up with three processes in the process table with the same program name but different process ids. -------------------------------------------------------------------- Question: I have a question about an aspect of phase 3 that I'm not sure has been addressed entirely. You've specified that if an instruction in an input file contains a value less than or equal to that of the system time, it should be executed. So if the next line in the instruction specifies a time that is equal to that of the system time, it can be executed without error. This is clear to me, but what I'm unsure about is whether or not to increment the system time after the execution of such an instruction. For example: In lines 11 and 12 in file in2-02.txt, the time for both is 19. After execution of the second command, should the system time increment to 20 or remain at the time specified in the input file (19)? Based on your sample output files, it seems that when two or more consecutive commands are executed with the same time parameter, the system clock will continue to increment when the input time is remaining constant. Thus, the 2 commands... 19 3 PTshowprocesses 19 2 PTshowscheduler after execution become... 19 3 PTshowprocesses 20 2 PTshowscheduler In this example, the system time will now be 1 number larger than the input time for each subsequent command and could potentially cause unexpected results for the remainder of the file. Answer: Yes, the system clock should be incremented by one each time an instruction is executed. Yes, this may cause the values shown in the output file for the time to be considerably different than those in the input file. Rest of Question: If this situation occurs multiple times in the same file, this effect will be magnified. The implications are small in our test cases, but in a real-world situation I believe it could cause major issues. I propose that we remedy the issue by either of the following: 1) Keep the system time consistent with that of the instructions in the file, provided that the input time is not less than the system time. 2) Don't allow consecutive commands to execute with the same time values. What are your thoughts on this? Is there a point in the current method that I'm missing? Rest of Answer: I don't think there is a simple fix to avoid the problems you described. You are correct that the simulated processor may not be able to keep up with the expectations of the individual simulated processes. So in a real system, when you delay a process for 5 seconds, it will be delayed for 5 seconds plus the time required for the cpu to get around to noticing it should continue. -------------------------------------------------------------------- Question: Is the memory supposed to be 1000 bytes or 1000 instructions? Answer: Memory is supposed to be 1000 instructions, i.e., each location holds a command such as r, s, or x and possibly an integer. -------------------------------------------------------------------- Question: In file out3-02.txt at time 70 (line 102-103), the order of the processes seems odd. It shows process 3 first and then process 2. What order should processes be displayed in? Answer: There was an error in the output file. The processes should be shown in order of process id for the PTshowprocesses command. I have updated the out3-02.txt file on the website and I have updated the description of Phase 3 to make this order clear. -------------------------------------------------------------------- Question: If someone tries to execute an invalid command, or otherwise recieves an error, does this count as 1 time execution unit? Answer: Yes, it counts as 1 time unit of execution. -------------------------------------------------------------------- Question In your example you have process 1 going to sleep for 6 time units at time 37. It says it is going to sleep until time 44. Shouldn't it sleep only to 37 + 6 = 43? If not, if no other processes were running would process 1 be able to run at time 44? Answer: 37 2 Process 1 will sleep until 44 The sleep command is supposed to set the time from the beginning of the next instruction so that if it does a "sleep 1", it will actually sleep one. Example: suppose that the time is 5 and "sleep 1" is issued. Process should sleep through the instruction being executed at time 6 and wake up in time to execute at time 7. In our case, the process issues the sleep command at time 37 (really during the interval from [37,38] I suppose). Then it sleeps for 6 time units: 38, 39, 40, 41, 42, 43. Then it should be woken up at time 44. It should be placed at the back of the Ready queue. However, it should be inserted after the process (process 0) that just finished its quantum. See this remark in the description: Unlike the normal Round Robin algorithm discussed in class, your scheduler should insert a process that finishes its quantum back in the Ready queue before any newly ready process, such as one that is beginning execution or leaving the Waiting state. The method for the scheduler described above performs the insertions in this way. -------------------------------------------------------------------- Question: If no processes are in either the Ready or Waiting queue, and no commands are ready from the input file, do we still run the "idle " process? Answer: Yes, print the idle message. -------------------------------------------------------------------- Question: I am having a problem with fast.xex. It seems that when I transfer it to Windows it stops being a normal text file. Answer: Yes, you need to transfer it from Unix to Windows or vice versa in text mode. The apparent size in bytes will change (if you can see the exact size), which is normal for text files when moving between the two systems. ---------------------------------------------------------------------