Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Apr 2003 15:42:26 -0400 (EDT)
From:      Daniel Eischen <eischen@pcnet1.pcnet.com>
To:        Narvi <narvi@haldjas.folklore.ee>
Cc:        threads@freebsd.org
Subject:   Re: Question about rtld-elf. Anyone?.. Anyone? 
Message-ID:  <Pine.GSO.4.10.10304291534330.6239-100000@pcnet1.pcnet.com>
In-Reply-To: <Pine.GSO.4.10.10304291413470.22036-100000@pcnet1.pcnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 29 Apr 2003, Daniel Eischen wrote:

> On Tue, 29 Apr 2003, Narvi wrote:
> > 
> > No, you would see the problem as soon as you tried to use a function that
> > used a locked structure, depending on how the dynamic linker did thinks
> > this might include any fiunction, including exec* - threads + forking
> > gives you really fascinating problems. How do you know that say malloc
> > state was consistent at the moment you forked? You really need
> > per-subsystem cleanups so that you won't occasionaly fail miserably. Its
> > not really the threads lib that can / should track locks, unless it comes
> > with its own copy of the subsystems.

In regards to inconsistent data (and not the state of the locks)...

You could have use an atfork() handler to reinitialize any
inconsistent data.  POSIX already defines pthread_atfork(),
and the kernel has at_fork(9) for kernel modules.  Perhaps
pthread_atfork() could be utilized by libc, being careful
to detect the potential for threads first.

-- 
Dan Eischen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10304291534330.6239-100000>