Subject: Re: pthreads and pmax
To: Simon Burge <simonb@wasabisystems.com>
From: Chris Johnson <cj.johnson@sun.com>
List: port-pmax
Date: 05/24/2001 18:03:59
> Simon Burge <simonb@wasabisystems.com>
>      Bob Lantz wrote:
>      > I seem to recall that problems with pthreads, mySQL, etc. were
>      > related to not having ll/sc or an atomic store syscall on non-R4000
>      > mips NetBSD systems.
>
> The problems with the databases are usually TAS problems (ie, ll/sc, or
> lack of [1]).
> There are some patches for pthreads that mostly work, but threads that
> use floating point fail badly.  I'll see if I can dig those patches up
> and have another look.

    On our Linux 2.0/MIPS system (QED 52xx based) there were problems
    on atomic memory because Linux was not guaranteeing that shared
    memory segments were aligned at a large enough boundary to avoid
    virtual aliasing on the cache index (16KB boundary).

    There was also a problem with the glibc FP varargs implementation
    that seemed to manifest most commonly on pthreads apps.  I seem to
    recall that the issue was a misaligned stack base in the subthreads
    interacting with a rounding/masking assumption in varargs.

    (The FP bug was pretty entertaining - GDB showed the calculations
    were done correctly, but printf() couldn't output the result.)

    We pushed both of these fixes to their respective code maintainers,
    but I don't know if they were ever folded into updates.

    After these fixes, pthreads and mySQL worked fine.  YMMV.

    cj*