Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Aug 2006 18:20:41 +0100 (BST)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Divacky Roman <xdivac02@stud.fit.vutbr.cz>, Perforce Change Reviews <perforce@freebsd.org>, Roman Divacky <rdivacky@freebsd.org>
Subject:   Re: PERFORCE change 103633 for review
Message-ID:  <20060811181817.C8215@fledge.watson.org>
In-Reply-To: <200608111249.44686.jhb@freebsd.org>
References:  <200608111110.k7BBAxIO059339@repoman.freebsd.org> <20060811124027.K45647@fledge.watson.org> <20060811121314.GA85207@stud.fit.vutbr.cz> <200608111249.44686.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060811181817.C8215>