help with function

My cdrw_terminate () function is not working properly. So the arrival() function generates process at tail of ready queue. The terminate() function removes process at head of ready queue. The The cdrw_arrival() function move head of ready queue to tail of cd/rw queue. And the cdrw_terminate() is supposed to move the head of cd/rw queue to the tail of cd/rw queue.

So like 'C#' is only supposed to work after like 'c#' was entered, and if 'C#' is able to complete task, then when entering 'c1' again, the PID# is supposed to be free again until it is terminated. Someone please help how to do the cdrw_terminate function().


Last edited on
someone please help me!
just pointing it out, on line 70 and 105:

if (cdrw_arrive > c || cdrw_arrive < 1){

you forgot the apostrophes

if (cdrw_arrive > 'c' || cdrw_arrive < '1'){

or am i wrong
Last edited on
The first problem is that:
when C1 is the first thing I enter it prints,
Process with PID 0 in CD/RW 1, when it should be printing,
Cannot signal completion interrupt- this CD/RW's queue is empty!

Another thing is that:
when I enter c1, then I enter C1,
Process with PID 1 in CD/RW 1, but pressing C1 again it says the same thing
again, when after the first time it is completed it should print,
Cannot signal completion interrupt- this CD/RW's queue is empty!

Last edited on
It keeps it the same. Nothing changes.
Last edited on
//
Last edited on
So the cdrw_terminate() is supposed to move the head of cd/rw queue to the tail of ready queue. I'm so confused as to like what value the head of cd/rw queue would be or whre it is actually pointing too?
Last edited on
I'm having issues with crdw_terminate() function, the problem is after entering c# and then C#, like if I enter c1
It asks for file name, location, r/w and if w the size.
So then, it says: Process with PID 1 sent to CR/DW 1.

So, I enter C1 again.
So, then it says, Done with process with PID 1 in CD/RW 1.

So, I enter C1 again.
It says, Done with process with PID 1 in CD/RW 1.
But it should say, Cannot signal completion interrupt- this CD/RW's queue is empty.
This repeats everytime I enter C1.
Why is it repeating?

That PID 1 should be free, so c1 can use it again, until PID 1 terminates.
Last edited on
Topic archived. No new replies allowed.