Where to get simple Boost Thread Management example?

前端 未结 2 905
名媛妹妹
名媛妹妹 2021-01-16 12:26

So I have a simple cpp file. Only one with one main function and 3 int a-la public variables. like:

   int a;
   int b;
   int c;
   void main()
   {
      s         


        
2条回答
  •  不思量自难忘°
    2021-01-16 12:57

    There is a series of articles starting here that should give you some initial pointers. The writer is responsible in large part for shepherding boost.thread into C++0x.

    List of the articles:

    Multithreading in C++0x Part 1: Starting Threads

    Multithreading in C++0x Part 2: Starting Threads with Function Objects and Arguments

    Multithreading in C++0x Part 3: Starting Threads with Member Functions and Reference Arguments

    Multithreading in C++0x Part 4: Protecting Shared Data

    Multithreading in C++0x Part 5: Flexible locking with std::unique_lock<>

    Multithreading in C++0x part 6: Lazy initialization and double-checked locking with atomics

    Multithreading in C++0x part 7: Locking multiple mutexes without deadlock

    Multithreading in C++0x part 8: Futures, Promises and Asynchronous Function Calls

提交回复
热议问题