What is easiest way to create multithreaded applications with C/C++?

前端 未结 15 1593
遥遥无期
遥遥无期 2021-02-06 11:05

What is the easiest way to create multithreaded applications with C/C++?

15条回答
  •  情深已故
    2021-02-06 11:14

    The C++0x specification includes threading facilities (one of my favorite new features). Soon it won't matter what OS you're compiling for! Just look how easy it is to create a new thread and join back to the creator thread:

    #include 
    #include 
    
    class SayHello
    {
    public:
        void operator()() const
        {
            std::cout<<"hello"<

    Visual Studio 2010 is implementing parts of C++0x but we're still waiting on the threading facilities.

提交回复
热议问题