lwkt_msgport.c

Matthew Dillon dillon at apollo.backplane.com
Wed Dec 31 16:08:04 PST 2003


:Hi !
:
:> functions does not add very much overhead as its just a value
:> being incremented by one.
:*Taking the teacher's hat*
:By 32, not one.
:*Dropping the teacher's hat*
:...
:Cheers and still a
:Happy New Year
:Peter
:<peter.kadau at xxxxxxxxxxxxxxxx>

    Right.  The LWKT thread's priority field also doubles as the critical
    section counter.  LWKT priorities range from 0-31.  A critical section
    is entered by adding 32 to the priority.

    There are overflow checks in the lwkt_token code as well as in
    conditionalized INVARIANTS code in crit_exit().  Hmm.  Actually, now
    that I look at it I should probably shift the overflow check in
    crit_enter().

    Why do I do things this way?  Well, it was probably overkill on my part
    but in my early LWKT work it actually reduced code complexity in the
    critical path by allowing certain priority & critical section checks to
    be collapsed into a single compare.  I could probably optimize things
    even more but there's a point when one has to judge a piece of work
    as 'done' and move on :-)

					-Matt
					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>






More information about the Submit mailing list