[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: kdelibs/arts/flow/gsl
From:       Bradley T Hughes <bhughes () trolltech ! com>
Date:       2001-09-25 6:48:06
[Download RAW message or body]

On Tuesday 25 September 2001 00:26, Stefan Westerfeld wrote:
>    Hi!
>
> On Mon, Sep 24, 2001 at 10:57:29AM +0200, Bradley T Hughes wrote:
> > doesn't compile on freebsd out of CVS, but i have fixed it to do so
> > now. however, there is things in the code that assumes linux
> > (intmax_t, dprintf, ERESTART) that aren't defined by POSIX or X/OPEN
> > SUS.
> >
> > I've attached the diff for what i believe is correct.
>
> Good, most things look like straightforward changes, I'll merge them in
> soon.
>
>
> The only thing that I am not sure of, is the use of $(USE_THREADS) and
> $(LIBPTHREAD). Is that only due to the one call of pthread_self()?
>
> Currently, all calls to pthread_* (besides this one call) are done from
> libmcop_mt. The theory of this is:

Yes, since this is in the flow lib, some things link with libflow, but not 
with libmcop, I think :)  All I remember was that I got unresolved symbols 
just when building arts/flow... I'll look a little harder this time and 
tell you which are needed

>  - you can use libmcop within a non-threaded application
>  - if you have a threaded application, you can link against libmcop_mt,
> and thread-usage will come as addon
>
> Now, I am not sure about the use of the $(USE_THREADS) flag, and whether
> or not FreeBSD allows such an idea of a library that is threaded under
> certain circumstances only at all. Currently, none of the other libs use
> $(USE_THREADS), besides libmcop_mt. Is this correct? Would it work if I
> would provide a suitable _self abstraction in libmcop and implement it
> in libmcop_mt (I can do this on a Friday only due to BC)?
>
> Or do I need to use $(USE_THREADS) everywhere? Do I then also need to
> link libpthread, making the whole idea of why it was seperated in two
> libs useless?

The general idea I get is USE_THREADS should be used if your app/lib uses 
threads.  From my experimentation with threading inside of Qt, on FreeBSD 
(and Linux or Solaris for what it's worth), a library can be linked into 
either a threaded or nonthreaded application, the final runtime libs are 
determined at application link time (on FreeBSD at least, since it uses 
libc_r for threaded).

I'll play with the build system a little more, but I'm assuming it's ok to 
submit the code changes (leaving the Makefile.am's out)?

> Are the FreeBSD/IRIX bugreports of mcopidl segfaulting in the build
> process caused by this (mcopidl uses $(USE_THREADS) more by accident
> than by strategy, I'd say ;)?

Actually, I've not had mcopidl crash on me recently.  It did before (ie. 
back when I first started playing with KDE 2.0), but I've not seen any 
problem since.

>    Cu... Stefan

-- 
--
Bradley T. Hughes <bhughes@trolltech.com>
Trolltech AS - Waldemar Thranes gt. 98 N-0175 Oslo, Norway
Office: +47 21604892
Mobile: +47 92019781

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic