Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Nov 1997 16:13:12 -0800
From:      Julian Elischer <julian@whistle.com>
To:        Alex Nash <nash@Mcs.Net>
Cc:        Curtis Bray <cbray@best.com>, freebsd-hackers@freebsd.org
Subject:   Re: malloc() problems in children after using rfork()
Message-ID:  <34762398.1CFBAE39@whistle.com>
References:  <Pine.BSF.3.95.971121151935.2450J-100000@Jupiter.Mcs.Net>

index | next in thread | previous in thread | raw e-mail

Alex Nash wrote:
> 
> On Fri, 21 Nov 1997, Curtis Bray wrote:
> 
> > Hi,
> >
> >   I'm trying to use rfork(RFPROC | RFMEM) so that all the children can
> > share the same address space with their parent.
> >
> >   If I have multiple children issuing mallocs the children seem to core
> > dump.  Once I turn the RFMEM flag off I have no problem mallocing (but
> > of course I loose the shared address space).  Anyone know what I could
> > be doing wrong here?  Do I have to put semaphores around every malloc??
> > I hope that's not the case...  Thanks in advance!
> 
> The only locking malloc() performs is pthread_mutex_lock/unlock in the
> libc_r version.  The non-threaded version provides no locking at all.
> 
> Alex

I just saw the other email

he's using 2.2.5
rfmem don't work in 2.2.x.
well it DOES but it only shares EXISTING memory.
new allocations are not shared..


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?34762398.1CFBAE39>