[PATCH] Bug #20116: Clarify barrier-like and mutex-like behaviours of PD->lock.

Florian Weimer fweimer@redhat.com
Mon Feb 13 18:49:00 GMT 2017


On 02/13/2017 02:29 PM, Carlos O'Donell wrote:
> +   It is important to point out that PD->lock is being used as a POSIX
> +   barrier and a POSIX mutex.  The lock is taken in the parent to force
> +   the child to wait, and then the child releases the lock, in effect a
> +   barrier.  However, this barrier-like effect is used only for
> +   synchronizing the parent and child.  After startup the lock is used
> +   like a mutex to create a critical region during which a single owner
> +   modifies the thread parameters.

I had missed that the lock was reused for the scheduler parameter.

But the current code still does not make sense to me.  Why do we need to 
keep a copy of the scheduler parameters at all?  Is this just a cache to 
improve performance, similar to what we used to do for the PID?

Thanks,
Florian



More information about the Libc-alpha mailing list