PERFORCE change 103633 for review
John Baldwin
jhb at freebsd.org
Fri Aug 11 17:50:04 UTC 2006
On Friday 11 August 2006 13:20, Robert Watson wrote:
> 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...
Yes, but my assumption is that it lets the easy cases just run in userland and
only goes into the kernel for a hard case, so you need to use atomic ops such
as casuptr().
--
John Baldwin
More information about the p4-projects
mailing list