tick size and timeslice

Not sure if this has been posted.

On QNX6, ticksize is 1 ms and timeslice is 4 ms. (why timeslice must be
equal to
4 times ticksize?)

Can we change the timeslice to another value (say, 20ms) while keeping
the ticksize =1.
Do we have a utility to get/set these values?

Thanks

Jerry <xwindow@yahoo.com> wrote:

Not sure if this has been posted.

On QNX6, ticksize is 1 ms and timeslice is 4 ms. (why timeslice must be
equal to 4 times ticksize?)

Because that’s the way its coded.

Can we change the timeslice to another value (say, 20ms) while keeping
the ticksize =1.
Do we have a utility to get/set these values?

No. You can change the ticksize, but the timeslice is always a fixed
multiple of the ticksize, so if you make the ticksize 5ms, you make the
timeslice 20ms.

Could you achieve what you want using cooperative multi-processing, that
is, FIFO scheduling and sched_yield() calls to give up control of the
CPU to the next thread at that priority?

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

“David Gibbs” <dagibbs@qnx.com> wrote in message
news:b1n84g$pr4$1@nntp.qnx.com

Jerry <> xwindow@yahoo.com> > wrote:
Not sure if this has been posted.

On QNX6, ticksize is 1 ms and timeslice is 4 ms. (why timeslice must be
equal to 4 times ticksize?)

Because that’s the way its coded.

Just wondering if there is any particular reason for choosing 4?
The context switch will occur very often thus more overhead. True?
I had this question because in QNX4 I remember the ticksize=1ms while
the timeslice = 50ms. this is big change fromQ4 to Q6.

Can we change the timeslice to another value (say, 20ms) while keeping
the ticksize =1.
Do we have a utility to get/set these values?


No. You can change the ticksize, but the timeslice is always a fixed
multiple of the ticksize, so if you make the ticksize 5ms, you make the
timeslice 20ms.

Could you achieve what you want using cooperative multi-processing, that
is, FIFO scheduling and sched_yield() calls to give up control of the
CPU to the next thread at that priority?

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

Jerry wrote:

“David Gibbs” <> dagibbs@qnx.com> > wrote in message
news:b1n84g$pr4$> 1@nntp.qnx.com> …

Jerry <> xwindow@yahoo.com> > wrote:

Not sure if this has been posted.

On QNX6, ticksize is 1 ms and timeslice is 4 ms. (why timeslice must be
equal to 4 times ticksize?)

Because that’s the way its coded.

Just wondering if there is any particular reason for choosing 4?
The context switch will occur very often thus more overhead. True?
I had this question because in QNX4 I remember the ticksize=1ms while
the timeslice = 50ms. this is big change fromQ4 to Q6.
The default ticksize for QNX4 is 10 msec. That was set when a 66Hz 486

was thought of as quite snappy. Clocks are now about an order of
magnitude faster, so …

Richard

Can we change the timeslice to another value (say, 20ms) while keeping
the ticksize =1.
Do we have a utility to get/set these values?


No. You can change the ticksize, but the timeslice is always a fixed
multiple of the ticksize, so if you make the ticksize 5ms, you make the
timeslice 20ms.

Could you achieve what you want using cooperative multi-processing, that
is, FIFO scheduling and sched_yield() calls to give up control of the
CPU to the next thread at that priority?

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

Jerry <xwindow@yahoo.com> wrote:

“David Gibbs” <> dagibbs@qnx.com> > wrote in message
news:b1n84g$pr4$> 1@nntp.qnx.com> …
Jerry <> xwindow@yahoo.com> > wrote:
Not sure if this has been posted.

On QNX6, ticksize is 1 ms and timeslice is 4 ms. (why timeslice must be
equal to 4 times ticksize?)

Because that’s the way its coded.

Just wondering if there is any particular reason for choosing 4?
The context switch will occur very often thus more overhead. True?
I had this question because in QNX4 I remember the ticksize=1ms while
the timeslice = 50ms. this is big change fromQ4 to Q6.

QNX4 had a default ticksize of 10ms, and timeslice of 50ms. 10->50 is
5*. But, with QNX4, you could never change the timeslice, just the ticksize.

This causes an issue, because of the implementation, the timeslice really
has to be a multiple of the ticksize – so if you changed your ticksize
to, say, 30ms, then how will timeslices work? 60, 60, 60? 60, 60, 30,
60, 60, 30? Ugh.

So, with QNX6, we said timeslice will be 4* ticksize, but we also said,
machines are faster nowadays – so the default ticksize was changed to 1ms.

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.