Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 122917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:12:16+00:00 2026-05-11T04:12:16+00:00

Been doing mostly Java and smattering of .NET for last five years and haven’t

  • 0

Been doing mostly Java and smattering of .NET for last five years and haven’t written any significant C or C++ during that time. So have been away from that scene for a while.

If I want to write a C or C++ program today that does some multi-threading and is source code portable across Windows, Mac OS X, and Linux/Unix – is PThread a good choice?

The C or C++ code won’t be doing any GUI, so won’t need to worry with any of that.

For the Windows platform, I don’t want to bring a lot of Unix baggage, though, in terms of unix emulation runtime libraries. Would prefer a PThread API for Windows that is a thin-as-possible wrapper over existing Windows threading APIs.

ADDENDUM EDIT:

Am leaning toward going with boost:thread – I also want to be able to use C++ try/catch exception handling too. And even though my program will be rather minimal and not particularly OOPish, I like to encapsulate using class and namespace – as opposed to C disembodied functions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T04:12:16+00:00Added an answer on May 11, 2026 at 4:12 am

    Well, pthreads is the old posix standard for writing threaded programs. Its the lowest level threading routines, so its a good choice for cross-platform threading.

    However, there are alternatives:

    • boost::thread – an STL style threading library
    • Intel’s Thread Building Blocks
    • OpenMP – both these are a higher-level way of writing threaded apps without needing to do any threading calls.

    As the latter are all fully supported on all platforms, (pthreads requires a bit of compiler settings as its only part of Windows posix subsystem, unless you want to use Pthreads-w32), then perhaps the latter ones are a better choice. boost::threads are more like a threading library, the other 2 are high-level ways of achieving parallelism without needing to code ‘threads’, they allow you to write loops that run concurrently automatically (subject to common-sense conditions)

    Boost::thread is not a C compatible library though.

    edit: cross-platform abilities of the above:

    Intel TBB is cross-platform (Windows*, Linux*, and Mac OS* X), supports 32-bit and 64-bit applications and works with Intel, Microsoft and GNU compilers.

    OpenMP depends on the compiler you want to use, but GCC and/or Intel compilers have supported OpenMP Windows, Linux and MacOS.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 91k
  • Answers 91k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer In a nutshell MSDN has your answer: "Enterprise Library, on… May 11, 2026 at 6:12 pm
  • Editorial Team
    Editorial Team added an answer If the only reason you need DAO is to compact… May 11, 2026 at 6:12 pm
  • Editorial Team
    Editorial Team added an answer Try yes | rm -r .git You were passing the… May 11, 2026 at 6:12 pm

Related Questions

Been doing mostly Java and smattering of .NET for last five years and haven't
I've been doing code review (mostly using tools like FindBugs) of one of our
I've been doing some Web-Projects lately that rely on heavy Data-Binding and have been
I've been doing iPhone development for the last 5 months or so, and have
I do mostly Windows development. We use Mantis and Subversion for our development but

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.