Re: GIO will link with -pthread soon



On 11/12/2009 11:36 AM, Michael Meeks wrote:
> 	The 'real' fix, is to recognise that:
> 
> 	a) interposing (excluding LD_PRELOAD) is a horrible expensive
> 	   feature, that more often than not causes problems

Well, you're talking about the specific thing that (presumably) is
causing gdb to fail here, but initializing threading support from inside
dlopen() is dubious no matter how it's implemented, because when you
enter dlopen(), it doesn't need to be using mutexes to protect the
symbol table, because the program is single-threaded, but by the time
dlopen() exits, it *does* need to be using mutexes. I suppose if
dlopen() itself is special-cased to deal with this particular case, AND
you ensure that dlopen() will never be called from inside any other
glibc method that might need to take a mutex, then you can ignore the
problem. At least on Linux. It's still a problem on some other
platforms, but they would have to be already working around it (eg,
http://mail-index.netbsd.org/tech-pkg/2004/11/24/0003.html).

-- Dan


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]