This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] New functions pthread_attr_[sg]et_default_np for default thread attributes


On 03/19/2013 02:56 PM, Rich Felker wrote:
> On Tue, Mar 19, 2013 at 11:16:47AM -0700, Roland McGrath wrote:
>>> Because the fork could have occurred when the default attributes are being
>>> updated, hence rendering them inconsistent. It doesn't cause a problem
>>> technically; just that we cannot guarantee predictable behaviour.
>>
>> So the two options are: take the lock in an atfork handler, so the update
>> is atomic with respect to fork as well; or declare that the user must
>> ensure that pthread_attr_set_default_np is not in progress when calling
>> fork, or results are unspecified.  Having a previous call to
>> pthread_attr_set_default_np always undone by fork, in the absence of any
>> race, does not seem like a sensible option to me.
> 
> All more great reasons this interface should not exist.

The issue of users wanting to tune runtime library defaults is not going
to go away. Developers also wish to have such functionality available.

I applaud efforts to iron out the details required to make this work at
runtime.

Roland, Siddhesh, Good job.

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]