> Wow!  In which area do you need more levels?  Are you aware of
> inactivity watchers?

Hm, what does this question mean? I never used them, the doc says "not yet
documented", and a mailing list scan reported that they are quite difficult to use
... Maybe I missed something. What is the point I should check more carefully?


>  ASYNC    0    1    2    3    4    5    6    7    IDLE
>                    HIGH      NORM

Oh, level 7 seems to be undocumented, I will try it ;-)


> Hm. There is a non-zero performance cost

So we have to search a compromise between flexibility and performance, I think. Of
course, I do not want to decrease performance.


> and none of my code needs more
> than 3-4 levels.  I like the simplicity of the current priority range.
> On the other hand, this isn't a big deal;  I am happy to increase it.
> But first, what perceived problem are you trying to address?

I'm working on this client server system which handles a lot of connections. Actions
have to be performed, commands can be started. There are more and less important
clients. There are running and new connections. Commands may be cancelled which
means that cleanups will start, these are events as well and are controlled by
timers. At least, there is an idle watcher which coordinates things. This is a state
machine, and I just recognized that I will possibly have to split it up into several
state machines - this means more idle watchers of different priorities (certain
states are more important than others because timeouts are running). So, having more
priority levels would give me a better granularity to order watcher executions.

Of course, choosing a watchers priority (and constructing a hierarchy of them) is a
different task because priority reflects importance, but has to take care of event
frequency, too. If high level events occur very often, lower levelled ones may never
be serviced.

To find a compromise - I think a number between 10 and 15 would be ok for now. It
may be increased again if necessary. But, by the way, how about making this an
installation parameter? The installer may decide which number of priority levels he
prefers - knowing that this will influence performance.

                            Jochen

Reply via email to