Is GCC dying without threads support on Windows? [closed]

I need some opinion. GCC was always a very good compiler, but recently it is losing “appeal”.
I have just found that on Windows GCC does not have std::thread support, forcing Windows users to use another compiler because the most exciting feature is still missing.

But why really doesn’t GCC still have threads support under Windows? License problems? ABI incompatibilities? (Well there are already several cross-platform libraries using multithreading: boost, POCO, SDL, wxwidgets, etc. Wouldn’t it be simple to use already existing, and MIT/libpng licensed, code to fit this hole instead of shipping GCC releases with no thread support?)

Recently, looking at compiler comparisons, GCC has the widest support for C++11 features with respect to other compilers, except for the fact that on Windows this is not true because we are still lacking atomics, mutexes and threads :/

I’d like to know more about this topic, but the only thing I can find is people asking for help because:

“thread” does not exist in std namespace

Looking at tickets tracking and mail discussions of GCC/TDM-GCC, there were requests for thread support since 2009. Possible that after 4 years still no solution? What’s really happening?

10

I understood that GCC is falling out of favour because the people maintaining it have become somewhat arrogant, and now that LLVM is here (and is very good) people are voting with the feet.

Slashdot had a discussion about LLVM’s new support for C++11. _merlin says:

Oh I don’t think anyone thinks it’s evil, just that it’s pure
self-interest rather than generosity. GCC’s phenomenal popularity has
led to its maintainers growing massive egos and behaving like total
[****]. Bugs are introduced faster than Red Hat and Apple can get
patches for them accepted, and they have a nasty habit of not looking
at bug reports, then closing them due to inactivity without actually
fixing them

which chimes in with your observation about the 4-year delay.

4

GCC’s popularity and usability is not questionable.

  • GCC is still great compiler and most widely used.
  • GCC supports languages that clang does not aim to, such as Java, Ada,
    FORTRAN, etc.
  • GCC supports more targets than LLVM.
  • GCC is supporting C++11

From
https://stackoverflow.com/questions/12210102/does-gcc-4-7-1-support-threads
mingw build at http://code.google.com/p/mingw-builds/downloads/list
supports threads.

But important consideration is License.

  • GCC is licensed under the GPL license. clang uses a BSD license, which allows it to be embedded in software that is not GPL-licensed.
  • The primary reason for switching from GCC to Clang is the incompatibility of GCC’s GPL v3 license with the goals of the FreeBSD project.

FreeBSD has an uneasy relationship with the GPL. BSD-license advocates
believe that truly free software has no usage restrictions. GPL
advocates believe that restrictions are necessary in order to protect
software freedom, and specifically that the ability to create non-free
software from free software is an unjust form of power rather than a
freedom. The FreeBSD project, where possible, tries to avoid the use
of the GPL (For details
https://unix.stackexchange.com/questions/49906/why-is-freebsd-deprecating-gcc-in-favor-of-clang-llvm)

Other important Considerations

From http://clang.llvm.org/comparison.html#gcc

  • The Clang ASTs and design are intended to be easily understandable by
    anyone who is familiar with the languages involved and who has a
    basic understanding of how a compiler works. GCC has a very old
    codebase which presents a steep learning curve to new developers.
  • Clang is designed as an API from its inception, allowing it to be
    reused by source analysis tools, refactoring, IDEs (etc) as well as
    for code generation. GCC is built as a monolithic static compiler,
    which makes it extremely difficult to use as an API and integrate
    into other tools. Further, its historic design and current policy
    makes it difficult to decouple the front-end from the rest of the
    compiler.
  • Various GCC design decisions make it very difficult to reuse: its
    build system is difficult to modify, you can’t link multiple targets
    into one binary, you can’t link multiple front-ends into one binary,
    it uses a custom garbage collector, uses global variables
    extensively, is not reentrant or multi-threadable, etc. Clang has
    none of these problems.
  • For every token, clang tracks information about where it was written
    and where it was ultimately expanded into if it was involved in a
    macro. GCC does not track information about macro instantiations when
    parsing source code. This makes it very difficult for source
    rewriting tools (e.g. for refactoring) to work in the presence of
    (even simple) macros.
  • Clang does not implicitly simplify code as it parses it like GCC
    does. Doing so causes many problems for source analysis tools: as one
    simple example, if you write “x-x” in your source code, the GCC AST
    will contain “0”, with no mention of ‘x’. This is extremely bad for a
    refactoring tool that wants to rename ‘x’.
  • Clang can serialize its AST out to disk and read it back into another
    program, which is useful for whole program analysis. GCC does not
    have this. GCC’s PCH mechanism (which is just a dump of the compiler
    memory image) is related, but is architecturally only able to read
    the dump back into the exact same executable as the one that produced
    it (it is not a structured format).
  • Clang is much faster and uses far less memory than GCC.
  • Clang aims to provide extremely clear and concise diagnostics (error
    and warning messages), and includes support for expressive
    diagnostics. GCC’s warnings are sometimes acceptable, but are often
    confusing and it does not support expressive diagnostics. Clang also
    preserves typedefs in diagnostics consistently, showing macro
    expansions and many other features.
  • Clang inherits a number of features from its use of LLVM as a
    backend, including support for a bytecode representation for
    intermediate code, pluggable optimizers, link-time optimization
    support, Just-In-Time compilation, ability to link in multiple code
    generators, etc.
  • Clang’s support for C++ is more compliant than GCC’s in many ways
    (e.g. conformant two phase name lookup).

From
http://www.linuxquestions.org/questions/slackware-14/gcc-vs-llvm-931034/

  • The advantage of llvm/clang is its modular design, so it can be
    interfaced and used for example to create static code analysis tools,
    what becomes more and more important ()

From http://clang.debian.net/

  • clang is now ready to build software for production (either for C,
    C++ or Objective-C). This compiler is providing many more warnings
    and interesting errors than the gcc suite while not carrying the same
    legacy as gcc.

4

The reason why it takes a lot of time is because it takes a lot of work to get a solid foundation to build the headers on top of. The way mingw-w64 seems to bo is to build a solid pthreads-like library on Windows. There’s less upstream grumpiness over that than introducing a dependency on the native threading of the Windows API.

mingw-w64 implements <thread> and the other C++11 headers on top of their own winpthreads library. This should be available for testing in both Mingw-builds and rubenvb’s distributions of the mingw-w64 toolchain. I would recommend following the mingw-w64 mailing lists if you want to track where most of the work on native Windows GCC work is done.

The Qt Project has a wiki page detailing their current recommendation and an over view of GCC toolchains on windows, see this Qt Project wiki page.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật