S
SB
I have an assignment where we are supposed to mimic a scheduler routine of
an OS. We are supposed to schedule some processes, an each process has the
following attributes...
- process id
- execution time
- memory size
All the above are int values. We have to prompt the user to input the number
of processes and then store those processes (with the 3 attributes) in a
vector. So the size of the vector is unknown until a user inputs a value for
the number of processes. My question is this...how would I store say 10
processes for example with each having the 3 attributes in parallel? What I
mean by that is, each process has an id, time and mem size, so if there are
10 processes, how would I know which execution time and mem size belonged to
which process id? Would I need to create a seperate vector for each process,
where each vector only contained one id, execution time and mem size? I'm
really hoping to do this with one vector. Can anyone help me understand how
to do this with one vector if possible?
Thanks!
an OS. We are supposed to schedule some processes, an each process has the
following attributes...
- process id
- execution time
- memory size
All the above are int values. We have to prompt the user to input the number
of processes and then store those processes (with the 3 attributes) in a
vector. So the size of the vector is unknown until a user inputs a value for
the number of processes. My question is this...how would I store say 10
processes for example with each having the 3 attributes in parallel? What I
mean by that is, each process has an id, time and mem size, so if there are
10 processes, how would I know which execution time and mem size belonged to
which process id? Would I need to create a seperate vector for each process,
where each vector only contained one id, execution time and mem size? I'm
really hoping to do this with one vector. Can anyone help me understand how
to do this with one vector if possible?
Thanks!