[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Increase PTHREAD_KEYS_MAX
In article <20150513082708.GI25832%homeworld.netbsd.org@localhost>,
Emmanuel Dreyfus <manu%netbsd.org@localhost> wrote:
>pthread_key_create() will refuse to create to create more than
>PTHREAD_KEYS_MAX pthread_key_t. I encountered situations
>where some Apache setup with various modules could not work
>reliabily on NetBSD because the value is too low. From time
>to time the server enters a state where it will not be able
>to serve requests.
>POSIX mandates PTHREAD_KEYS_MAX to be at least _POSIX_THREAD_KEYS_MAX,
>which should be 128 according to POSIX:
>Oddly it is 256 in NetBSD's <limit.h>
>The values are:
>MacOS X: 512
>Obviously we lag behind and software will suit NetBSD less and less over the
>time. Since it is often the result of shared usage by modules from different
>developers, we cannot blame anyone for overflowing _POSIX_THREAD_KEYS_MAX
>usage as a requirement.
>I suggest for netbsd-7
>- fix _POSIX_THREAD_KEYS_MAX to be 128 instad of 256
>- increase PTHREAD_KEYS_MAX to 2048 so that we lead again for some time
> this would increase memory footprint of programs linked with -lpthread
> of 14 kB on ILP32 systems, and 28 kB on LP64 systems.
>And for later:
>- Think about a dynamic allocation. For now we have an array, could we
>have a queue?
Just make it an array that is dynamically allocated based on an environment
variable; this is what others do (it seems).
Main Index |
Thread Index |