EaTea / OS-glowing-ninja

OS-Project-FunFun
1 stars 1 forks source link

Files are being preprocessed instead of read #2

Open EaTea opened 12 years ago

EaTea commented 12 years ago

In the current implementation, we are reading a file to completion before we begin scheduling.

The project specification reads: "Reading a line is equivalent to the execution of a line in our framework, as if the line is like a machine language instruction."

It makes no sense (as a simulation) to read the entire file first in this regards; we ought to restructure our program. A possible way to do this is to associate a file pointer with a PROCESS struct.

EaTea commented 12 years ago

@nictheman

As per our last discussion, I'm now not entirely sure whether the whole "read the file line by line" is possible or feasible (you could use fseek but that sounds rather silly).

Instead, it might be a good idea to compute the time of the job as we parse it? That would be a better idea (I guess?) than trying to seek through the file stream?

nictheman commented 12 years ago

Yes, we want to compute the job time as we parse it. This could be a little bit tricky though, I can't really work out the patterns or algorithm involved. But it's definitely theway we do it, judging by help forum comments.