Skip to content

Use of C++11 concurrency library instead of pthreads. #45

Closed

Description

@m-renaud

To allow for more portable code, would it be feasible to replace the use of pthreads with the new C++11 concurrency library? It could be enabled when configured to build with cpp0x support (which at this point should be renamed to cpp11). What are your thoughts?

Activity

  1. etr commented on Mar 6, 2014

    @etr
    Owner

    It seems a very good idea to me. The only reason I am not using C++11 right now on the library is to allow backward compatibility.
    A good way to do so, and avoid to pollute the code with a big number of ifdef constructs would be to wrap the pthreads functionalities currently in use in the library in an isolated API and to implement there the preprocessor logic that makes use of the concurrency library when the cpp11 option is passed.
    Thank you for sharing the idea.

  2. etr commented on Mar 8, 2014

    @etr
    Owner

    continue this discussion on issue #46

  3. LeSpocky commented on Nov 17, 2021

    @LeSpocky
    Contributor

    Meanwhile C++11 is required and C++14 is recommended for libhttpserver. Can you reconsider this issue?

    (Just stumbled over a pthread_mutex_init() in the code and was surprised because there's platform independent thread and mutex support from C++11 onwards.)

  4. etr commented on Nov 17, 2021

    @etr
    Owner

    This issue was raised at a time when the library wasn't even C++11 compatible (outside for custom build flags). I think it does make sense at this point to move to a C++ native implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions