Search:

Type: Posts; User: spendotw

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. How do I work out the AWT and TAT in my code ?

    I am having problems calculating the average turn around time and average waiting time in my program. Can anyone give me some advice where i am going wrong please? :( :confused: I am first trying to...
  2. There was a lot of unecessary stuff in the...

    There was a lot of unecessary stuff in the previous code:
    I removed the needToContinue flag. And now the current state of the program is that it compiles, it runs and executes all the priority 0's...
  3. Actually i'v just looked back at this and i can...

    Actually i'v just looked back at this and i can see that it doesn't process the processes with priority of 0 it processes them all but is displaying them with a priority of 0

    Feel free to ignore...
  4. Thanks for your feedback guys, I have took what...

    Thanks for your feedback guys, I have took what you said into consideration, but with some of the terminology used I didn't quite understand :\ sorry.

    Right, after revising my code I have managed...
  5. :confused: *sigh* as i said im a noob to C, I...

    :confused: *sigh* as i said im a noob to C, I have tried to implement what has been said but this is still not working my awful code bellow decrements the priority member variable once but thats it,...
  6. Thanks for this analogy it really helps...

    Thanks for this analogy it really helps...
  7. Hi I am trying to do this program without...

    Hi

    I am trying to do this program without using any custom functions and just using the basic system functions

    I have already sorted all my priorities and ordered them from lowest to highest,...
  8. Yes this is exactly what I wanted to implement,...

    Yes this is exactly what I wanted to implement, but I have no idea how to do so... I have altered my code as below, but it only decrements the first process continously until it reach zero rather...
  9. Yeah I mean it executes fine, its just my...

    Yeah I mean it executes fine, its just my algorith is a bit off. For what I need to do I am require to do the round robin scheduling slightly different. I have to decrement all the quantum from the...
  10. Thanks Quzah, any help on this issue :(

    Thanks Quzah, any help on this issue :(
  11. Hi, I don't see where this would fit in my...

    Hi, I don't see where this would fit in my program? Although the priority member is the variable I am trying to control, it doesn't help me to process the data entries with a priority of 0 all...
  12. I need help with looping lowest priority values first

    Hi there, i am writting a process scheduler in a round robin fashion and I want to process all the processes from a input file. I have got all the processes from the file and ordered the priority...
  13. no, qsort is not in a while loop... Let me...

    no, qsort is not in a while loop...

    Let me start fresh
    Heres the source code:


    #include <stdio.h>
    #include <stdlib.h>
    #include <sys/types.h>
    #include <sys/stat.h>
  14. I have, and it did work but when i try to...

    I have, and it did work but when i try to implement the same to my program i cant seem to find where i am going wrong :\

    i mean i know the compare function is different in my program to a...
  15. Oh sorry that was because i re typed it and was a...

    Oh sorry that was because i re typed it and was a bit sloppy there....

    iv compiled with warning and get no warnings at all now

    any reason why qsort doesn't sort from 0 ?
  16. Actually looking back out the output this qsort...

    Actually looking back out the output this qsort function still doesn't seem to give the correct output as it doesn't print any priority variable with the value of 0. It seems to order the priority...
  17. Replies
    7
    Views
    2,761

    Okay, so like for an expression as such i > j ...

    Okay, so like for an expression as such i > j
    when i is never going to be more than j

    Either way, if it is endless how will that help my variables to be processed in a rounded fashion rather...
  18. Replies
    7
    Views
    2,761

    Oh right sorry Salem I wasn't aware I couldn't...

    Oh right sorry Salem I wasn't aware I couldn't post my question on other forums. I dont usually do this, it was just under the circumstances i am in.

    I though the loop was endless in the sense...
  19. Replies
    7
    Views
    2,761

    ????

    ????
  20. Replies
    7
    Views
    2,761

    Loop doesnt continously execute

    Hi there i am writting a process scheduler and im confused at this point in my code below....

    When i compile the program, it compiles successfully and decrements the structure member qaunta by -1...
  21. Okay, i think i'v found the issue /*...

    Okay, i think i'v found the issue



    /* elsewhere in the program */
    qsort(proc, 199, sizeof(*proc), comp);

    for ( i = 0; i < 199; i++)
    printf("sorted priority: %d\n",...
  22. Well after i called qsort, i wanted to print...

    Well after i called qsort, i wanted to print proc[i].priority afterwards to see if it has moved my data around in the correct order as you said, so that i can oricess it in the correct order. This...
  23. Ahh thanks that got it to compile. Do i need to...

    Ahh thanks that got it to compile. Do i need to add anything to the comp function, such as comparison between int A and int B? Because when I run my program my output is this and it doesn't seem to...
  24. yeah i tried that before but i kept getting these...

    yeah i tried that before but i kept getting these errors :(

    example.c: In function ‘comp’:
    example.c:29:14: error: ‘process’ undeclared (first use in this function)
    example.c:29:14: note: each...
  25. I'm still getting this error when implementing...

    I'm still getting this error when implementing the code you provided:



    int comp(const void *a, const void *b) {
    return ((proc*)a)->priority - ((proc*)b)->priority;
    }


    example.c: In...
Results 1 to 25 of 40
Page 1 of 2 1 2