Re: [patch] Re: dlopen() and dlclose() are not MT-safe? YES, esp. for libthr



I did understand the purpose of the thread mask code in
libexec/rtld/rtld_lock.c, or, more precisely, the condition where this code
works (for the context, see the mails with same subject on freebsd-hackers).

Look, that code assumes that blocking async signals would stop thread
scheduler from doing preemption of the current thread. This works
for libc_r, but fails in libpthread and libthr cases. libpthread provides
implementation of the locks for rtld. But libthr does not !

As result, rtld exhibit races when used with libthr. In other words,
libthr needs code to do proper locking.

Do you agree ? Does somebody already planned to do this work ?

Best regards,
Kostik Belousov

Attachment: pgp9lql298eyd.pgp
Description: PGP signature



Relevant Pages

  • Re: libc_r is deprecated
    ... In the libthr vs. libpthread ... it could well be that libpthread reduces kernel lock ...
    (freebsd-arch)
  • Re: libc_r is deprecated
    ... libpthread, and libthr is way behind. ... how libpthread doesn't handle SMP scheduling well either. ... especially embarresing because libc_r is a single process, ...
    (freebsd-arch)
  • Re: libc_r is deprecated
    ... libpthread, and libthr is way behind. ... how libpthread doesn't handle SMP scheduling well either. ... especially embarresing because libc_r is a single process, ...
    (freebsd-arch)
  • Re: Building a new workstation - dual or quad-core CPU for FreeBSD 7?
    ... so performance may not suffer much from libpthread. ... Oh I wasn't sure if libthr was the preferred thread library for 6.2 ... RAID1OS array with mysql logs, replication logs, ... RAID1+0innodb mysql data. ...
    (freebsd-questions)
  • Re: Looks like threading is b0rken on FreeBSD/powerpc
    ... I think you might want to try point libpthread at libthr with ... for libpthread. ... when checking the errno set after calling accessto check if a file ... there is a plan to bump libthr version when symbol versioning ...
    (freebsd-current)