[PATCH 1/2] Delay pthread_atfork registering.

Jason Evans jasone at canonware.com
Tue Oct 22 13:33:37 PDT 2013


On Oct 21, 2013, at 2:11 PM, Leonard Crestez <lcrestez at ixiacom.com> wrote:
> This function causes recursive allocation on LinuxThreads.
> 
> Signed-off-by: Crestez Dan Leonard <lcrestez at ixiacom.com>
> ---
>  src/jemalloc.c | 23 ++++++++++++-----------
>  1 file changed, 12 insertions(+), 11 deletions(-)

We should probably keep the pthread_atfork() call prior to releasing init_lock (just need to move it up a couple of lines).  Although jemalloc cannot completely prevent races between allocator initialization and fork(2), it can at least prevent races if all threads allocate prior to the fork().

Thanks,
Jason


More information about the jemalloc-discuss mailing list