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?

有帮助吗?

解决方案

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.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top