|
From: Bart V. A. <bar...@gm...> - 2008-01-21 07:03:30
|
On Jan 20, 2008 9:51 PM, Nicholas Nethercote <nj...@cs...> wrote: > On Sun, 20 Jan 2008, Bart Van Assche wrote: > > > Changes: > > - The exp-drd regression tests now run without producing assertion > > failures and without hanging on Red Hat 7.3. It doesn't make sense > > however to run exp-drd on Red Hat 7.3 -- while exp-drd works fine with > > the NPTL, more work would be required to make exp-drd work with > > linuxthreads. > > Is it possible to detect linuxthreads at startup and abort with an > explanation? If exp-drd can't do anything useful on linuxthreads, we don't > want people to run it and think their program is ok. Do have any idea how many Linux systems are based on linuxthreads and did not yet switch to the NPTL ? What happens when you run exp-drd under linuxthreads is that lots and lots of false positives are printed -- exp-drd is basically unusable under linuxthreads. There exist some Linux distributions which include both an NPTL and a linuxthreads implementation, with NPTL as default, e.g. MontaVista Linux 4. These distributions allow to select a thread implementation at runtime. The only reliable way I know of to detect linuxthreads at runtime is to call getpid(), create a new thread, call getpid(), and compare the two process ID's. When both ID's are equal, the process is started under NPTL. If not, then the process is started with linuxthreads. Such a test can only be performed from client code. Note: the current implementation of Helgrind also only supports the NPTL. Regards, Bart. |