On Mon, Mar 12, 2001 at 10:58:29AM -0500, Alexander Viro wrote:
>       What I mean is quite simple - objects in cred.cache can be
> shared, but to change the contents of object you need to make sure
> that you are the sole owner of that object. I.e.
> 
> modify_cred(cred, ...)
> {
>       if ((*cred)->count > 1) {
>               old_cred = *cred;
>               *cred = copy_cred(old_cred);
>               put_cred(old_cred);
>       }
>       /* modify *cred */
> }
> 
>       IOW, no third-part changes of contents. Simple, easy to prove
> the correctness. Pthreads folks can just do modify_cred() for process
> credentials of all memebers of thread group. IMO trying to be smart
> and  physically share the credentials for all threads is wrong.

This sounds like the kind of thing which the read-copy update strategy
was designed to solve.

modify_cred(&cred, ...)
{
        new_cred = copy_cred(cred);
        /* modify cred */
        *cred = new_cred;
        add_idle_free(*cred);
}

as i understand the read-copy update strategy anyway.

-- 
Revolutions do not require corporate support.
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]

Reply via email to