Date: Wed, 30 Apr 2003 19:20:10 -0700 From: Terry Lambert <tlambert2@mindspring.com> To: Peter Wemm <peter@wemm.org> Cc: Daniel Eischen <eischen@pcnet1.pcnet.com> Subject: Re: Question about rtld-elf. Anyone?.. Anyone? Message-ID: <3EB0845A.FA34BA04@mindspring.com> References: <20030501011103.6E20D2A7EA@canning.wemm.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Peter Wemm wrote: > As John said, the problem is twofold. One is the symbol resolution itself, > eg: when you access a function for the first time, a lazy binding call > happens. He had ideas about how to make that fully reentrant. It doesn't need to be; the pointer update is atomic, so it's safe for two threads in the same process at the same time (or there would have been much more spectacular fireworks, before now), and if it happens over a fork(), then the child process gets a stale copy, and does the lazy binding call itself, triggering a COW in the page where the lazy-bound verion should have been. Either way, it still works (you just get an extra page in the child that you wouldn't have had, had you waited). > The second problem was preventing dlopen() and friends being > called in parallel. It sounds like you've dealt with only the > second problem... I don't think the first problem needs to be dealt with at all; I don't think dealing with the second problem is something you want anyway (see other post, and see chapter 12 of the corrigenda). I think the real prolem is that the threaded code in question is broken, and thinks that the thread that was involuntarily preempted should be restarted, instead of the highest priority thread available, when it gets its next quantum. In other words, the code was written to expect a specific type of pthreads implementation, and is failing to comply with POSIX. -- Terry
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3EB0845A.FA34BA04>