OpenBSD Journal

New Threading Support, Upgrade Notes

Contributed by jose on from the careful-upgrade dept.

Recently, OpenBSD's core C library was changed to handle threaded applications slightly differently. This will have implications for people doing upgrades to the future snapshots and builds. From the commit message last week, which details the changes and upgrade path:
Bye-bye libc_r.   libc_r and libnpthread go away.  libpthread
takes their place.  The -pthread option to gcc uses libpthread.
ppc portion of patch from drahn@ (thanks).   gcc portions of patch
OK espie@.   Ports testing (no bad effects!) by naddy@
best build sequence is: build gcc, build system, build ports
remove /usr/lib/lib{c_r,npthread}.*.   Note, once libc_r and
libnpthread is removed threaded ports will stop working until
they have been re-built using the libpthread and the updated gcc.
That's why the above build sequence is recommended.
So, the next time you upgrade keep this in mind. This should fix a few applications, by the way, which use threading extensively.

(Comments are closed)


Comments
  1. By Anonymous Coward () on

    What applications would this fix?

    Comments
    1. By Eduardo Augusto Alvarenga () eduardo@thrx.dyndns.org on mailto:eduardo@thrx.dyndns.org

      An index explaining exactlly what applications must be recompiled and will be a big help for -current seekers.

      Is there anything like 'make key=libpthread show' in ports?

      Comments
      1. By Anonymous Coward () on

        ldd can help

      2. By Anonymous Coward () on

        If you are running -current, you should be able to figure it out.

        If you can't figure it out, you should either learn how to do it yourself, or not run -current.

        Comments
        1. By James () quel@gnu.org on http://quel.linux-dude.com

          that was quite possibly the most unhelpful post ever. *BSD takes a bad wrap even worse than linux for having people that deem newbies a waste of time and just respond RTFM. And on top of that respond well if yo ucan't figure out you are too stupid to be using it in the first place. Yes I taught myself linux and *bsd and now run several servers. That does not mean however that just because most of us were 100% self taught that we should choose to point our noses up at all those wishing to take up the fine art of *nix.

          quel

          Comments
          1. By Anonymous Coward () on

            I agree. If you think your special because you run -current, you're not. Get over the elitism. If you can help someone, do so. If you cant, telling them to RTFM isnt going to help at all. I'm sure they've thought of it.

          2. By bbcrack () on

            but as the docs say all over the place only run -current if you know what your doing. if you dont run stable.

          3. By djm () on

            No, it is really simple: if you don't intimately understand the system and know how to help yourself when things change, then don't run -current.

            -current isn't like "Debian unstable" or any of those other perpetually-beta Linux distributions, it is intended for developers. You are usually building shit which people committed to CVS days or hours ago - you are totally on your own.

            If this doesn't look like your cup of tea, then use the snapshot releases - these are for people why want to try the new stuff, but not have to worry so much.

            Comments
            1. By Anonymous Coward () on

              yes but those things that are in -current are going in so they can be in -stable in a few months. Some people like to understand what new features are going to be available in the next release so they can learn about them more and be able to utilize them effectively.
              So yeah, use -current only if you know what you are doing. Everybody else has a few months to learn, and asking questions is a very valid way of doing that.

        2. By Anonymous Coward () on

          You shouldn't try to emulate deraadt if you can't
          see the difference between a time wasting stupid
          question and a reasonable doubt. Further more,
          this is not misc@, and if you don't know what I
          mean by that, then may be you shouldn't be reading
          this site.

        3. By Anonymous Coward () on

          What if the person asking the question is not running -current, and not wanting to run -current, but just interested in what this means.
          I agree that people who don't understand what they're doing should stick to -stable. But that doesn't mean they can't be interested in what's going on in current, since that's what'll be in the next release in 6 months.
          People running -current and doing development themselves will understand perfectly what's going on, but others won't. So I think the OP just wanted to know what may be the practical consequence of this change in the next release.

    2. By Marc Espie () espie@openbsd.org on `

      The ones that use libraries linked with libc AND libc_r.
      Linker might get less confused, bugs might disappear.

      A few apps also suddenly recognize libpthread because
      of autoconf hackery, not sure this is a good thing.

      In general, things get lighter. You just load libc and libpthread instead of libc and libc_r.

      Smaller footprint, less confusion, things better in general.

      Hard to tell you more, haven't looked precisely... it's impossible to focus on 4GB of source code, which is about what ports/ is these days...

      but, yeah, the switch to libpthread is definitely a good thing.

      If you follow -current, just test.

      If you don't, hope enough people test -current.

      But anyways, even if you're a lazy bum sitting on his ass, next release of OpenBSD is going to have better thread support, and that includes MORE running applications.

      Comments
      1. By Anonymous Coward () on

        Do the Jan 22 snapshots contain the new libpthread code?

        Comments
        1. By Anonymous Coward () on

          New libpthread (2003/01/14)

          The answer to your question is "yes".

      2. By AnonymousCanuck () on

        Ok. So I am crazy. I would like to help test -current. Is there a guide to help me?

        Will it be much work?

        Do I have to continously recompile my system?

        Will this just be a waste of time?

        Comments
        1. By Anonymous Coward () on

          If you cant figure this out on your own, then -current is not for you.

  2. By AC () on

    Some files go away and some new ones show up, some programs stop working while others are happy... What about telling why these changes are made and what is the difference between new threads and the old ones? Hope I make any sense...

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]