higher speed mutexes

David Xu davidxu at freebsd.org
Mon Jan 10 16:07:35 PST 2005


Petri Helenius wrote:

>
> What happens if the process holding the lock dies?
>
>> In detail, I don't use thr_suspend and thr_wakeup, I use more 
>> reliable way:
>> umtx_wait + umtx_wake, I have added them into kernel sometimes ago.
>>
> I was looking at the umtx routines and wondering if I could use them 
> instead of pthread API.
>
I will add owner list, when a thread blocked on umtx, an owner list
will be created for the umtx,  and blocked thread will  lookup the owner
in system, if there is no the owner, the owner was dead, kernel marks
the umtx is in broken state, next locker will find the brokeness, and
still gets the lock successfully but with errno is EPIPE, if a thread exits
with its owner list not empty, in thr_exit, kernel will mark all umtxes
to broken state, and wake up a waiter on each umtx, the waiter should
find the brokeness...., it will let do priority proction and priority 
inherit
mutex for POSIX..., I am looking for time to do it....

David Xu





More information about the freebsd-threads mailing list