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 1/2] Set default stack size from program environment


> This was the first thing I had thought of - interposing pthread_create
> to call pthread_attr_set_stacksize in the module.  That was however
> rejected as being hacky and 'having to be maintained by *them*
> separately'.

That's not what I suggested.  Interposition has a lot of problems.  The
suggestion of experimenting with preload modules was in the context of
having a proper API call available to set the default.

> How about extending this idea to have a module to configure all major
> pthread default attributes (stacksize, guardsize, detachstate,
> schedpolicy, schedparam, etc.) so that it's not just a
> stacksize-specific hack?  I was toying with this idea as part of
> libpthread, but I guess putting it in a module is a better idea. That
> way, not wanting this customization comes with no penalty.

Experimental preload modules can do whatever you like.  When we get to a
proposal to include a particular module in the libc sources, we'll examine
the specific details of what's being proposed.  All of this is predicated
on having interfaces in the API to set the defaults.  Since we're
considering things beyond stacksize, I think it makes most sense to have a
single general-purpose interface.  That is, use the existing pthread_attr_*
interfaces for the details and then just add one call to use a pthread_attr_t
to modify the global defaults.


Thanks,
Roland


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