thread accounting in libpthread

Julian Elischer julian at elischer.org
Sun Feb 20 20:53:28 PST 2005


David Xu wrote:
> 
> 
> Julian Elischer wrote:
> 
>> David Xu wrote:
>>
>>> Daniel Eischen wrote:
>>>
>>>> ...
>>>>
>>>> since it will be the only thread in the queue.  If N threads
>>>> complete (assuming they are all at the same priority) then
>>>> the first thread pulled from the completed list will be
>>>> run first since it will be the first thread added to the
>>>> run queue.
>>>>
>>>>  
>>>>
>>> note that kernel adds completed thread in reversed order.
>>
>>
>>
>> I guess we could fix that easily with a tail pointer.

No, I think that the kernel could queue up "completed" threads on the ksegrp
in the reverse order to now by adding them to the end of the list instead of the 
head.

nothing else need know except that function.

> 
> 
> This will break binary compatible, userland can workaround it.

The userland doesn't know the order they completed (except to assume that it is 
backwards)

> 
> David Xu



More information about the freebsd-threads mailing list