PERFORCE change 103633 for review

Robert Watson rwatson at FreeBSD.org
Fri Aug 11 17:20:47 UTC 2006


On Fri, 11 Aug 2006, John Baldwin wrote:

>> I think the main problem (which is now fixed) was with this:
>>
>> 	copyin(addr, val1);
>> 	if (val1 == val2)
>> 	   	....
>>
>> being non-atomic. On the other hand I tried to use other locks other then 
>> Giant and it didnt work. I hope to investigate that later. Now I have this 
>> working and my focus is elsewhere.
>
> No, what you have done is wrong.  The idea of doing copyin() and then 
> compare is just plain not going to work. :)  You will need to use casuptr() 
> or the like similar to the umtx code.  This is assuming that a futex can be 
> manipulated from userland w/o entering the kernel.

I assume that we can basically just do whatever Linux does here for 
synchronization...

Robert N M Watson
Computer Laboratory
University of Cambridge


More information about the p4-projects mailing list