GCC 4.4.0 - Can't activate threading support

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

GCC 4.4.0 - Can't activate threading support

Casull
Hi All,

I've been trying to build GCC 4.4.0 for use with cygwin, and despite the fact that the build succeeds, I can't seem to activate threading even when supplying the --enable-threads=posix configure option. What am I doing wrong in order to activate thread support in gcc for cygwin ?

Thanks,

O.
Reply | Threaded
Open this post in threaded view
|

Re: GCC 4.4.0 - Can't activate threading support

Dave Korn-6
Casull wrote:

> I've been trying to build GCC 4.4.0 for use with cygwin, and despite the
> fact that the build succeeds, I can't seem to activate threading even when
> supplying the --enable-threads=posix configure option. What am I doing wrong
> in order to activate thread support in gcc for cygwin ?

  What symptom or behaviour makes you think that threading is /not/
"activated"?  The --enable-threads=posix option always works fine for me.

    cheers,
      DaveK

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply | Threaded
Open this post in threaded view
|

Re: GCC 4.4.0 - Can't activate threading support

Casull

Well actually, maybe saying that threading isn't activated is not the correct way to describe my problem. I am basically trying to take advantage of the C++0x implementation provided by GCC 4.4 through the <thread> header for example. The GCC 4.4 implementation of std::thread is guarded by the following preprocessing directive:

   #if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)

When looking at the bits/c++config.h, _GLIBCXX_USE_C99_STDINT_TR1 is defined but _GLIBCXX_HAS_GTHREADS isn't.

I know that GCC has its own implementation of threads called gthreads (that std::thread relies on) which itself is a wrapper around POSIX threads (or other flavours depending on configuration).

Either I am not passing the correct flags to GCC (in addition to the -std=c++0x) or my installation of gcc is not correct, or last possibility, my GCC build configuration is not correct.

Thanks,

O.

Dave Korn-6 wrote
Casull wrote:

> I've been trying to build GCC 4.4.0 for use with cygwin, and despite the
> fact that the build succeeds, I can't seem to activate threading even when
> supplying the --enable-threads=posix configure option. What am I doing wrong
> in order to activate thread support in gcc for cygwin ?

  What symptom or behaviour makes you think that threading is /not/
"activated"?  The --enable-threads=posix option always works fine for me.

    cheers,
      DaveK

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
Reply | Threaded
Open this post in threaded view
|

Re: GCC 4.4.0 - Can't activate threading support

Dave Korn-6
Casull wrote:

> I am basically trying to take advantage
> of the C++0x implementation provided by GCC 4.4 through the <thread> header
> for example. The GCC 4.4 implementation of std::thread is guarded by the
> following preprocessing directive:
>
>    #if defined(_GLIBCXX_HAS_GTHREADS) &&
> defined(_GLIBCXX_USE_C99_STDINT_TR1)
>
> When looking at the bits/c++config.h, _GLIBCXX_USE_C99_STDINT_TR1 is defined
> but _GLIBCXX_HAS_GTHREADS isn't.

  Ah.  There is an autoconf test in libstdc++-v3 that defines that, and the
comment says:

> dnl Check if gthread implementation defines the types and functions
> dnl required by the c++0x thread library.  Conforming gthread
> dnl implementations can define __GTHREADS_CXX0X to enable use with c++0x.

> Either I am not passing the correct flags to GCC (in addition to the
> -std=c++0x) or my installation of gcc is not correct, or last possibility,
> my GCC build configuration is not correct.

  Well, I think there's  one other possibility: Cygwin (or perhaps the newlib
core) don't define or support all the "types and functions required by the
c++0x library".  I'll take a look and see if I can find out why it would fail.

    cheers,
      DaveK





--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply | Threaded
Open this post in threaded view
|

Re: GCC 4.4.0 - Can't activate threading support

Dave Korn-6
Dave Korn wrote:

> Casull wrote:
>> The GCC 4.4 implementation of std::thread is guarded by the
>> following preprocessing directive:
>>
>>    #if defined(_GLIBCXX_HAS_GTHREADS) &&
>> defined(_GLIBCXX_USE_C99_STDINT_TR1)
>>
>> When looking at the bits/c++config.h, _GLIBCXX_USE_C99_STDINT_TR1 is defined
>> but _GLIBCXX_HAS_GTHREADS isn't.
>
>   Ah.  There is an autoconf test in libstdc++-v3 that defines that, and the
> comment says:
>
>> dnl Check if gthread implementation defines the types and functions
>> dnl required by the c++0x thread library.  Conforming gthread
>> dnl implementations can define __GTHREADS_CXX0X to enable use with c++0x.

  It fails because :

// In case of POSIX threads check _POSIX_TIMEOUTS too.
#if (defined(_PTHREADS) && (!defined(_POSIX_TIMEOUTS) || _POSIX_TIMEOUTS <= 0))
#error
#endif


... we don't have any definition of _POSIX_TIMEOUTS.  That's a feature test
macro the exact definition of which I haven't found yet, but from libstdc's
point of view, it appears to mean that the pthread_mutex_timedlock function is
supported.  Which indeed Cygwin doesn't currently implement.

http://www.opengroup.org/onlinepubs/009695399/functions/pthread_mutex_timedlock.html

  Looks like it wouldn't be too hard to add, PTC I suppose.

    cheers,
      DaveK


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply | Threaded
Open this post in threaded view
|

Re: GCC 4.4.0 - Can't activate threading support

Casull

What can be done to add the pthread_mutex_timedlock function to the pthread implementation of cygwin ? And what does the PTC achronyme mean ? :)

Dave Korn-6 wrote
Dave Korn wrote:
> Casull wrote:
>> The GCC 4.4 implementation of std::thread is guarded by the
>> following preprocessing directive:
>>
>>    #if defined(_GLIBCXX_HAS_GTHREADS) &&
>> defined(_GLIBCXX_USE_C99_STDINT_TR1)
>>
>> When looking at the bits/c++config.h, _GLIBCXX_USE_C99_STDINT_TR1 is defined
>> but _GLIBCXX_HAS_GTHREADS isn't.
>
>   Ah.  There is an autoconf test in libstdc++-v3 that defines that, and the
> comment says:
>
>> dnl Check if gthread implementation defines the types and functions
>> dnl required by the c++0x thread library.  Conforming gthread
>> dnl implementations can define __GTHREADS_CXX0X to enable use with c++0x.

  It fails because :

// In case of POSIX threads check _POSIX_TIMEOUTS too.
#if (defined(_PTHREADS) && (!defined(_POSIX_TIMEOUTS) || _POSIX_TIMEOUTS <= 0))
#error
#endif


... we don't have any definition of _POSIX_TIMEOUTS.  That's a feature test
macro the exact definition of which I haven't found yet, but from libstdc's
point of view, it appears to mean that the pthread_mutex_timedlock function is
supported.  Which indeed Cygwin doesn't currently implement.

http://www.opengroup.org/onlinepubs/009695399/functions/pthread_mutex_timedlock.html

  Looks like it wouldn't be too hard to add, PTC I suppose.

    cheers,
      DaveK


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
Reply | Threaded
Open this post in threaded view
|

Re: GCC 4.4.0 - Can't activate threading support

Dave Korn-6
Casull wrote:
>
> What can be done to add the pthread_mutex_timedlock function to the pthread
> implementation of cygwin ?

  http://cygwin.com/contrib.html

> And what does the PTC achronyme mean ? :)

  http://cygwin.com/acronyms/#PTC  :)

    cheers,
      DaveK

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/