NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: dlopen, &c., and threads

Taylor R Campbell <> wrote:

> I see nothing in src/libexec/ld.elf_so synchronizing concurrent uses
> of the dlopen family of functions in multiple threads.  The SUS does
> not require them to be thread-safe, but is it intended, or documented
> anywhere, that these are not in NetBSD; or am I missing something
> about the implementation?

I see no mention of thread safety.  As SUS doesn't require them to be
thread safe, there doesn't seem much point in making them so (they'd be
single threaded per-process in the kernel anyway, very likely) so you
might as well use a mutex in your application and be portable.

Disclaimer: I speak as one with more experience than I'd really like
working on threads implementations (kernel and libraries) but in my own
code I avoid threading wherever possible.  Multiple cooperating
processes are usually cleaner IMHO, but that's not always possible, I
know.  Especially when someone dumps an already written multithreaded
application on you. :-/



Home | Main Index | Thread Index | Old Index