Question

Anyone know why certain fields in proc.h in Minix are char, when I thought they'd be int?

 37   char p_ticks_left;            /* number of scheduling ticks left */

 38   char p_quantum_size;          /* quantum size in ticks */

So, if we want to add a new "int" field should we make it a char?

Was it helpful?

Solution

If char is big enough to hold all the necessary values, why not use it? Of course, int may be somewhat more performant, but at the same time char is usually smaller.

I believe you can use any type that makes sense.

OTHER TIPS

consider from design, maybe It's enough to save value of "number of scheduling ticks left" and "quantum size in ticks". and size of char is smaller than size of int.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top