Hello, everyone.
I am trying to make a simple simulation of memory usage using a round-robin, first-fit approach. I am using a struct array to predetermine the attributes of the processes that will attempt to use the simulated "memory" array. The attributes are size, arrival time, and duration time. I know I'll have to use a queue as the "memory" array is filled and new "processes" are waiting their turn.
The big problem I am running into right now is once a "process" has found its "fit," how do I start the countdown until termination for that "process," and at the same time let the new loop for the next "process" start. The way I have it set up, it will not start looking for a space for the next one until the duration time for the first process is up. I also want it to step in when that time is up and let the user know that it has exited.
Any ideas? Thanks if you can help.
I am trying to make a simple simulation of memory usage using a round-robin, first-fit approach. I am using a struct array to predetermine the attributes of the processes that will attempt to use the simulated "memory" array. The attributes are size, arrival time, and duration time. I know I'll have to use a queue as the "memory" array is filled and new "processes" are waiting their turn.
The big problem I am running into right now is once a "process" has found its "fit," how do I start the countdown until termination for that "process," and at the same time let the new loop for the next "process" start. The way I have it set up, it will not start looking for a space for the next one until the duration time for the first process is up. I also want it to step in when that time is up and let the user know that it has exited.
Any ideas? Thanks if you can help.
Attachments
-
61 KB Views: 57