void ct_set_countdown( unsigned n );
By default, the scheduler scrunches the queues every time it has run a fixed number of threads, defined in the ct.h header as CT_DEFAULT_COUNTDOWN. This default is arbitrary, and may not be appropriate for a given application.
The ct_set_countdown function enables an application to specify how many threads to run between scrunching operations.
This parameter governs the strength of prioritization among threads. For example, with the countdown set to 8 threads per scrunch (the default), threads with a priority of zero will run about 8 times as frequently as those with a priority of one, about 64 times as frequently as those with a priority of two, and so forth.
Setting the countdown to a higher value will increase the difference in frequency among threads at different priorities. Conversely, setting it to a lower value will reduce the difference. Thus the ct_set_countdown function is one of the available tools for tuning the scheduler.
If the application saves the return value it can restore the previous value of the countdown.